cool-easter-32542
07/07/2023, 12:01 PMPATH does not include the virtual environment bin folder.
Code to reproduce:
# BUILD
python_sources()
python_requirement(
name="req",
requirements=["ninja"]
)
pex_binary(
name="bin",
entry_point="main.py"
)
# main.py
import subprocess
subprocess.run(['ninja', '--help'])
Running the bin target raises a FileNotFoundError: [Errno 2] No such file or directory: 'ninja' exception.
Pants version
2.16.0
OS
MacOS
Additional info
When using virtual env, activate adds the <virtual-env>/bin folder to PATH. This allows the program to run subprocess.call on any binary that was packed with one of the program dependencies.
pantsbuild/pants