rich-london-74860
03/20/2024, 7:26 PMpants
, then the subprocess (which is spawned with sys.executable
- the python executable without any virtual environment) fails because it cannot import that 3rd-party dependency (since it does not have a virtual environment with the 3rd-party dependency). Is there an easy way to preserve dependencies for child subprocesses?
To be more specific, I want to run the dagster
CLI with the dev
command, which spawns a subprocess herebitter-ability-32190
03/20/2024, 9:07 PMrich-london-74860
03/20/2024, 9:30 PMpex_binary
target that depends on the python_requirement
target for the 3rd-party dependency, with the entry_point
configured to the main module.
Is there a better way?bitter-ability-32190
03/20/2024, 11:47 PMbitter-ability-32190
03/20/2024, 11:48 PMrich-london-74860
03/21/2024, 1:36 AMYou can run the python_requirement directly (as of some version of pants)Yes, in this particular case, that doesn't work because for the command I want to run, the 3rd-party dependency needs another 3rd-party dependency to be installed. For the
pex_binary
target I have both 3rd-party dependencies specified in dependencies
Also, if your PEX runs in venv mode I think this issue goes awayYes, that worked! Thank you!
broad-daybreak-7542
03/22/2024, 7:23 PM