https://pantsbuild.org/ logo
#general
Title
# general
w

wide-zoo-86070

03/07/2022, 7:49 PM
when bootstrap pants using
./pants --version
, I see the following error
Copy code
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))': /simple/virtualenv/
ERROR: Could not find a version that satisfies the requirement virtualenv==20.4.7 (from -r requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for virtualenv==20.4.7 (from -r requirements.txt (line 1))
.pex/venvs/32a5dda4259a11b7add428d3f3e5656078dd2fe0/f28b3dbba3c9dae1b4357adde5b079b8b3ca9fac/pex --disable-pip-version-check --no-python-version-warning --exists-action a --use-deprecated legacy-resolver --isolated -q --cache-dir .pex download --dest /tmp/tmpwm2e_tsu/data.user.miniconda3.bin.python3.7 --requirement requirements.txt --index-url <https://pypi.org/simple> --retries 5 --timeout 15
Is there a way to pass other --index-url?
p

polite-garden-50641

03/07/2022, 8:11 PM
can u make sure you are using the latest pants script? available at
<https://static.pantsbuild.org/setup/pants>
also I am assuming you are on a mac?
do u have python installed? what is the output of
which python3
w

wide-zoo-86070

03/08/2022, 3:23 PM
Hi @polite-garden-50641, regarding the Restricted Internet Access, I was trying to use the binary. But I got the following error when I do
./pants --version
. Any idea?
Copy code
$ ./pants --version
10:20:17.38 [INFO] Initializing scheduler...
10:20:17.58 [ERROR] no path specified
p

polite-garden-50641

03/08/2022, 3:33 PM
Hmm 🤔 never encountered that particular error message. Can you run with ‘-ldebug’
w

wide-zoo-86070

03/08/2022, 4:15 PM
Copy code
./pants --version -ldebug
11:13:46.93 [DEBUG] acquiring lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7f88d6dacfa0>
11:13:46.93 [DEBUG] purging metadata directory: /Users/xxx/PycharmProjects/example-python2/.pids/9da86e233ee0/pantsd
11:13:46.93 [DEBUG] Launching pantsd
11:13:46.93 [DEBUG] purging metadata directory: /Users/xxx/PycharmProjects/example-python2/.pids/9da86e233ee0/pantsd
11:13:46.94 [DEBUG] pantsd command is: PANTS_DAEMON_ENTRYPOINT=pants.pantsd.pants_daemon:launch_new_pantsd_instance PYTHONPATH=/Users/xxx/.pex/venvs/314154c5afbb5a405f8ada71e9f4ce8270c35f57/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055:/opt/anaconda3/lib/python38.zip:/opt/anaconda3/lib/python3.8:/opt/anaconda3/lib/python3.8/lib-dynload:/Users/xxx/.pex/venvs/s/e2898bd6/venv/lib/python3.8/site-packages: /Users/xxx/.pex/venvs/s/e2898bd6/venv/bin/python3.8 /Users/xxx/.pex/venvs/314154c5afbb5a405f8ada71e9f4ce8270c35f57/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055/pex --version -ldebug
11:13:48.18 [DEBUG] pantsd is running at pid 62545, pailgun port is 57750
11:13:48.18 [DEBUG] releasing lock: <pants.pantsd.lock.OwnerPrintingInterProcessFileLock object at 0x7f88d6dacfa0>
11:13:48.18 [DEBUG] Connecting to pantsd on port 57750
11:13:48.19 [DEBUG] Connecting to pantsd on port 57750 attempt 1/3
11:13:48.19 [DEBUG] Connected to pantsd
11:13:48.21 [DEBUG] Launching 1 roots (poll=false).
11:13:48.22 [DEBUG] computed 1 nodes in 0.010648 seconds. there are 7 total nodes.
11:13:48.32 [INFO] Initializing scheduler...
11:13:48.33 [DEBUG] File handle limit is: 10000
11:13:48.52 [DEBUG] Changes to /Users/xxx/.pex/venvs/314154c5afbb5a405f8ada71e9f4ce8270c35f57/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055, outside of the buildroot, will not be invalidated.
11:13:48.52 [DEBUG] Changes to /Users/xxx/.pex/venvs/314154c5afbb5a405f8ada71e9f4ce8270c35f57/779eb2cc0ca9e2fdd204774cbc41848e4e7c5055, outside of the buildroot, will not be invalidated.
11:13:48.52 [DEBUG] Changes to /opt/anaconda3/lib/python38.zip, outside of the buildroot, will not be invalidated.
11:13:48.52 [DEBUG] Changes to /opt/anaconda3/lib/python3.8, outside of the buildroot, will not be invalidated.
11:13:48.52 [DEBUG] Changes to /opt/anaconda3/lib/python3.8/lib-dynload, outside of the buildroot, will not be invalidated.
11:13:48.52 [DEBUG] Changes to /Users/xxx/.pex/venvs/s/e2898bd6/venv/lib/python3.8/site-packages, outside of the buildroot, will not be invalidated.
11:13:48.52 [DEBUG] Changes to /Users/xxx/PycharmProjects/example-python2, outside of the buildroot, will not be invalidated.
11:13:48.52 [ERROR] no path specified
p

polite-garden-50641

03/08/2022, 4:18 PM
can u share the content of your pants.toml ?
I wonder where pants finds the references to the .pex and an anaconda3 directories... I think that is why pants is confused.
👍 1
w

wide-zoo-86070

03/08/2022, 4:20 PM
Copy code
# Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

[GLOBAL]
pants_version = "2.9.0+git4dcb7437"
backend_packages.add = [
  "pants.backend.python",
  "pants.backend.python.lint.docformatter",
  "pants.backend.python.lint.black",
  "pants.backend.python.lint.flake8",
  "pants.backend.python.lint.isort",
  "pants.backend.python.typecheck.mypy",
]

# This will become the default in 2.11, and is only explicitly set to not break
# backwards-compatibility for existing users. If you are setting up Pants for
# the first time, set this to false.
use_deprecated_python_macros = false

[anonymous-telemetry]
enabled = true
repo_id = "3B1D361B-E9F1-49A8-B761-03DCC41FD58E"

[source]
# The Python source root is the repo root. See <https://www.pantsbuild.org/docs/source-roots>.
root_patterns = ["/"]

[python]
# The default interpreter constraints for code in this repo. Individual targets can override
#  this with the `interpreter_constraints` field. See
#  <https://www.pantsbuild.org/docs/python-interpreter-compatibility>.
#
# It's usually a good idea to pin this to a particular version, e.g. `==3.9.*`. We only use a range
# so that this example works on many different machines.
#
# If you use Apple Silicon, set to a value like `>=3.9`.
interpreter_constraints = [">=3.7"]

# Use a constraints file. See <https://www.pantsbuild.org/docs/python-third-party-dependencies>.
requirement_constraints = "constraints.txt"

[python-bootstrap]
# We search for interpreters on both on the $PATH and in the `$(pyenv root)/versions` folder.
#  If you're using macOS, you may want to leave off the <PATH> entry to avoid using the
#  problematic system Pythons. See
#  <https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path>.
search_path = ["<PATH>", "<PYENV>"]
It is basically the one in example-python except the pants_version.
p

polite-garden-50641

03/08/2022, 4:58 PM
@hundreds-father-404 any ideas?
h

hundreds-father-404

03/08/2022, 5:32 PM
Oh actually one idea! Try using Pants 2.8.0 https://github.com/pantsbuild/pants/releases/tag/release_2.8.0. I'm wondering if https://github.com/pantsbuild/pants/pull/13842 is related, I've had issues in the past with the release PEX and the
--venv
mode
Also my apologies @wide-zoo-86070 for not replying to the other thread! I'm sorry you're still having issues getting Pants to work, I appreciate you sticking with it and hope we can figure this out soon
w

wide-zoo-86070

03/08/2022, 6:15 PM
no worries @hundreds-father-404. I will try 2.8 and let you know. We will figure it out.
🤞 1
❤️ 1
em. @hundreds-father-404 after downloading 2.8
Copy code
$ ./pants --version -ldebug
env: python3.7: No such file or directory
👀 1
h

hundreds-father-404

03/08/2022, 6:47 PM
This is running the PEX, not the bash script? What if you do
python3.8 ./pants.pex
or
python3.9 ./pants.pex
? That is, do not rely on the shebang
w

wide-zoo-86070

03/08/2022, 6:49 PM
Copy code
python3.9 ./pants --no-verify-config --version
13:49:44.54 [INFO] Initialization options changed: reinitializing scheduler...
13:49:45.04 [INFO] Scheduler initialized.
2.8.0+gitc6fa199e
ok. it seems working for 2.8.
🙌 1
Hopefully it helps you understand the issue, so we can ‘fix’ it later?
btw, why it is trying to use python3.7 instead of python3.9 or others?
h

hundreds-father-404

03/08/2022, 6:55 PM
Okay great. It actually really does help a ton! Thank you so much for sticking with this and reporting the issue. So turns out that https://github.com/pantsbuild/pants/issues/11954 is still an issue (oof). We didn't catch that with https://github.com/pantsbuild/pants/pull/13842, which changed to use
--venv
because that gives you the fastest performance. Re the shebang, we were hardcoding python3.7 which wasn't very helpful. The first two fixes in https://github.com/pantsbuild/pants/issues/11954 improve that so you should be able to run
./pants.pex
and it work if you don't have python3.7 installed
👍 1
w

wide-zoo-86070

03/15/2022, 9:42 PM
hi @hundreds-father-404, is this issue going to be fixed in pants 2.10? wanna try 2.10 when it is available.
h

hundreds-father-404

03/15/2022, 9:44 PM
Ah thank you for the reminder. It's not yet fixed, but I agree it should be for 2.10
❤️ 1
8 Views