quaint-forest-8735
06/07/2022, 9:24 PMrequirements.txt
in a pex file, and the following command succeeds:
pex --interpreter-constraint CPython==3.9.12 -r requirements.txt -o test.pex
However, when attempting to run it with ./test.pex
I encounter the following error:
/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9: can't find '__main__' module in '/path/to/test.pex'
I'm able to produce smaller pex files and run them without a problem (ie. pex --interpreter-constraint CPython==3.9.12 numpy pandas -o test.pex
), but am encountering this error any time I attempt to include the full requirements. I have confirmed after unzipping test.pex
that __main__.py
exists. The pex file is ~700M currently. I came across this issue: https://github.com/pantsbuild/pex/issues/958 and was wondering if this might be relatedwitty-crayon-22786
06/07/2022, 9:27 PM--layout packed
as mentioned there?quaint-forest-8735
06/07/2022, 9:30 PM--layout packed
witty-crayon-22786
06/07/2022, 9:55 PMThis succeeds, though it appears to produce a directory instead of a standalone file?correct.
Does this function identically to a standalone file from the perspective of the pants jupyter plugin etc?it should?… having a
__main__.py
should be picked up by any interpreterquaint-forest-8735
06/07/2022, 9:56 PMwitty-crayon-22786
06/07/2022, 9:56 PMquaint-forest-8735
06/07/2022, 9:57 PM--layout packed
since I realized that the existing venv/
in my directory was also being included in the pex file (along w/ other extraneous stuff like bazel build directories etc) -- down to a much saner ~25M