You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a problem where I could not import python code written locally in my code. I can import modules from my virtual environment, but not locally written python code.
To solve, I needed to set PYTHONPATH, but there was no way to do this with the current code.
I worked around it by patching the IpcPipeCom.js file to pass through environment variables:
Yeah, environment variables set in Node.js with process.env aren't applied to the actual current OS process, but they are treated as such by the Node.js code that checks process.env. As the process' env vars aren't updated, they don't propagate to created child processes, so you do need to pass in the new env vars like you did here.
I am loading
pythonia
from a node host process.I ran into a problem where I could not import python code written locally in my code. I can import modules from my virtual environment, but not locally written python code.
To solve, I needed to set PYTHONPATH, but there was no way to do this with the current code.
I worked around it by patching the
IpcPipeCom.js
file to pass through environment variables:JSPyBridge/src/pythonia/IpcPipeCom.js
Line 17 in ed32525
Then, i can set any environment variables in my node process and have them influence the child python process.
The text was updated successfully, but these errors were encountered: