Skip to content

Commit

Permalink
fix: fix pythonhelper
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrBox committed Jul 24, 2024
1 parent 2c6eef9 commit da0c3af
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/legacy/main/PythonHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ bool pythonInited = false;

bool initPythonRuntime() {
if (!pythonInited) {
script::py_interop::setPythonHomePath(lse::getSelfPluginInstance().getPluginDir());
script::py_interop::setPythonHomePath(lse::getSelfPluginInstance().getModDir());
script::py_interop::setModuleSearchPaths({
lse::getSelfPluginInstance().getPluginDir() / "python310.zip",
lse::getSelfPluginInstance().getPluginDir() / "DLLs",
lse::getSelfPluginInstance().getPluginDir() / "Lib",
lse::getSelfPluginInstance().getPluginDir() / "site-packages",
lse::getSelfPluginInstance().getModDir() / "python310.zip",
lse::getSelfPluginInstance().getModDir() / "DLLs",
lse::getSelfPluginInstance().getModDir() / "Lib",
lse::getSelfPluginInstance().getModDir() / "site-packages",
});
pythonInited = true;
}
Expand Down Expand Up @@ -231,8 +231,8 @@ bool processConsolePipCmd(const std::string& cmd) {
// (./plugins/legacy-script-engine/lib/python-env/Lib/site-packages)
int executePipCommand(std::string cmd) {
if (cmd.find("--disable-pip-version-check") == std::string::npos) cmd += " --disable-pip-version-check";
cmd = ll::string_utils::u8str2str((lse::getSelfPluginInstance().getPluginDir() / "python.exe").u8string()) + " -m"
+ cmd;
cmd =
ll::string_utils::u8str2str((lse::getSelfPluginInstance().getModDir() / "python.exe").u8string()) + " -m" + cmd;

SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
Expand Down

0 comments on commit da0c3af

Please sign in to comment.