<#2037 Building Pex with requirements.txt that inc...
# github-notifications
q
#2037 Building Pex with requirements.txt that includes local directory + Python version specifier fails Issue created by rajaie-sg Assume I have a file,
reqs.txt
with the contents below:
Copy code
mylibrary @ file:///Users/rajaiealkorani/code/mylibrary ; python_version >= "3.7" and python_version < "4.0"
Let's say I generated this file running
poetry export
. If I run
pex --resolver-version pip-2020-resolver -r reqs.txt -o /tmp/testing.pex
, then run
/tmp/testing.pex
, and then
import mylibrary
in the Python interpreter, I get an error
No module named 'mylibrary'
If I try building the Pex file using a reqs.txt as below, then I am able to properly import
mylibrary
Copy code
mylibrary @ file:///Users/rajaiealkorani/code/mylibrary"
It looks like adding Python version specifiers for the local package causes it not to get installed. Is this expected? I am using Pex
2.1.120
pantsbuild/pex