Skip to content

Commit

Permalink
add site-packages to env
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesneimog committed Nov 26, 2024
1 parent 9a90723 commit f72d3c2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Resources/Pd/pd4web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,18 @@ static void *pd4web_new(t_symbol *s, int argc, t_atom *argv) {
x->python = "\"" + x->objRoot + "\\.venv\\Scripts\\python.exe\"";
x->pd4web = "\"" + x->objRoot + "\\.venv\\Scripts\\pd4web.exe\"";
#elif defined(__APPLE__)
std::string PATHS = "PATH=" + x->objRoot + "/.venv/bin:/usr/local/bin:/usr/bin:/bin";
std::string PATHS = "PATH=" + x->objRoot + "/.venv/bin:";
std::string venv_folder = x->objRoot + "/.venv/lib/";
for (const auto &entry : std::filesystem::directory_iterator(venv_folder)) {
std::string folder = entry.path().filename().string();
if (folder.find("python") != std::string::npos) {
venv_folder += folder;
break;
}
}
post("[pd4web] venv folder: %s", venv_folder.c_str());
PATHS += venv_folder + "/site-packages:";
PATHS += "/usr/local/bin:/usr/bin:/bin";
putenv((char *)PATHS.c_str());
x->pythonGlobal = "python3";
x->pip = "\"" + x->objRoot + "/.venv/bin/pip\"";
Expand Down

0 comments on commit f72d3c2

Please sign in to comment.