diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 2c0954b..ee5725a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ #include <vector> #include <string> #include <cmath> +#include <cstdlib> #include <boost/python.hpp> #include <boost/filesystem/operations.hpp> @@ -117,10 +118,11 @@ main(int argc, char** argv) fs::path full_path(fs::current_path()); updateIfNeeded(); - - Py_Initialize(); + auto pypath = full_path.string() + ":" + full_path.string() + "/lib/"; + setenv("PYTHONPATH", pypath.c_str(), 1); Py_SetPythonHome(const_cast<char*>(full_path.string().c_str())); + Py_Initialize(); py::object main_module = py::import("__main__"); py::object global = (main_module.attr("__dict__")); |