best-furniture-15331
05/09/2023, 10:21 PMImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: <https://github.com/urllib3/urllib3/issues/2168>
I was not previously getting this error, it started yesterday (Sean said May 4 for them). I’ve tried recreating my previous setup using the steps below. (FYI our pants_version is 2.13.0)
Steps
1. Made a fresh clone of our repo
2. Made a fresh branch from an earlier commit hash (April 25)
3. Made a fresh virtual env (I don’t think this matters for Pants, but did it anyway)
4. Cleaned out the ~/.cache/pants
dir on my local system
5. Ran ./pants --version
, which fails with the above ImportError.
What am I missing? I can only think of 2 reasons this could happen:
1. Some permanent change to my system was made that’s somehow influencing Pants (though I don’t believe it should, since it’s hermetic execution)
2. During Pants bootstrapping, live resources are pulled independent of local configuration (or there’s a config setting that could fix this, but I do not yet know of it)
I’m new to Pants, so thank you for your help and patience!broad-processor-92400
05/09/2023, 10:30 PMPIP_CONSTRAINTS
suggestion in https://pantsbuild.slack.com/archives/C046T6T9U/p1683661374866099?thread_ts=1683574114.661669&cid=C046T6T9U should help with this installation issue.best-furniture-15331
05/09/2023, 10:42 PM./pants
blanket fails with that ImportError. I downloaded an updated ./pants
script that sources .pants.bootstrap
, and added the constraints. I confirmed that it’s detecting the file, though I’m not sure how to confirm whether it’s correctly passing those constraints to pip--any guidance?
I can see in ~/.cache/pants/…/2.13.0_py39/lib/python3.9/site-packages/
that the urllib3 version is 2.0.2, despite setting urllib3<2 in constraints../pants
installer?enough-analyst-54434
05/10/2023, 1:20 AMjsirois@Gill-Windows:~/dev/pantsbuild/example-django (main) $ rm -rf ~/.cache/pants/setup/
jsirois@Gill-Windows:~/dev/pantsbuild/example-django (main) $ echo "urllib3<2" > constraints.txt
jsirois@Gill-Windows:~/dev/pantsbuild/example-django (main) $ PIP_CONSTRAINT=constraints.txt ./pants -V
Bootstrapping Pants using /home/jsirois/.pyenv/shims/python3.9
Creating the virtualenv PEX.
Downloading the Pex PEX.
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.103/pex> verified.
Installing pantsbuild.pants==2.14.0 into a virtual environment at /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.14.0_py39
New virtual environment successfully created at /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.14.0_py39.
18:19:02.76 [INFO] Initializing scheduler...
18:19:02.92 [INFO] Scheduler initialized.
2.14.0
jsirois@Gill-Windows:~/dev/pantsbuild/example-django (main) $ ls -l /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.14.0_py39/lib/python3.9/site-packages/ | grep urllib3
drwxr-xr-x 6 jsirois jsirois 4096 May 9 18:18 urllib3
drwxr-xr-x 2 jsirois jsirois 4096 May 9 18:18 urllib3-1.26.15.dist-info
That's for the pantsbuild/example-django repo using the checked-in ./pants
script just now.guess my local python interpreter somehow got “corrupt” and is passing that onBoth
pants
and ./pants
create a venv as a 1st step. It's just that pants
uses a hermetic interpreter and `./pants`picks one from your system - but either way its a fresh new venv. They each then install pantsbuild.pants
in the fresh venv using pip install ...
and thus the PIP_*
env var trick works..pants.bootstrap
for clarity. Perhaps you can do that too to rule out weirdness there 1st?jsirois@Gill-Windows:~/dev/pantsbuild/example-django (main) $ rm -rf ~/.cache/pants/setup/
jsirois@Gill-Windows:~/dev/pantsbuild/example-django (main) $ PIP_CONSTRAINT=spam.txt ./pants -V
Bootstrapping Pants using /home/jsirois/.pyenv/shims/python3.9
Creating the virtualenv PEX.
Downloading the Pex PEX.
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.103/pex> verified.
Installing pantsbuild.pants==2.14.0 into a virtual environment at /home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/2.14.0_py39
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'spam.txt'
WARNING: You are using pip version 21.1.2; however, version 23.1.2 is available.
You should consider upgrading via the '/home/jsirois/.cache/pants/setup/bootstrap-Linux-x86_64/pants.F188cA/install/bin/python -m pip install --upgrade pip' command.
best-furniture-15331
05/10/2023, 1:27 AMexport
to my .pants.bootstrap
file so that must’ve been the problemPIP_CONSTRAINT=constraints.txt
without export)enough-analyst-54434
05/10/2023, 1:33 AM