Skip to content

Commit

Permalink
feat: set executable path for embedded interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-vincent committed Jul 24, 2024
1 parent ff1270b commit e6dfd43
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/endstone_runtime/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ ENDSTONE_RUNTIME_CTOR int main()
py::initialize_interpreter(&config);
py::module_::import("threading"); // https://github.com/pybind/pybind11/issues/2197
py::module_::import("numpy"); // https://github.com/numpy/numpy/issues/24833
py::exec(R"(
import os
import sys
if sys.platform == "win32":
sys.executable = os.path.join(sys.prefix, "python.exe")
else:
sys.executable = os.path.join(sys.prefix, "bin", "python")
)");
py::gil_scoped_release release{};
release.disarm();

Expand Down

0 comments on commit e6dfd43

Please sign in to comment.