Hi all. I have a python project that will spawn a ...
# general
j
Hi all. I have a python project that will spawn a shell process which runs a few python scripts. I guess that’ll call the python env in the host machine, not in the sandbox env. Is there a way to make it use the python env in the sandbox instead?
e
Pants aside,
subprocess.run([sys.executable, ...], ...)
reuses the current Python environment right?
j
yeah, but the python environment didn’t have all the packages installed. (I don’t know how pants installed all dependencies and where they goes, maybe in the sandbox?)
e
That is encoded in
sys.path
, you can pass some or all of that on to a subprocess via
PYTHONPATH
.