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

ancient-rose-27306

08/19/2022, 3:56 AM
I am trying to bootstrap pants on my personal computer which is an Apple MacBook Pro running macOS Mojave. I am using Anaconda and created a new environment called pants with python 3.7. I created a
pants.toml
file and downloaded
pants
script. Afterwards when I ran the command
./pants --version
, its giving me following error:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
Bootstrapping Pants using /opt/anaconda3/envs/pants/bin/python3.7
Creating the virtualenv PEX.
Downloading the Pex PEX.
SHA256 fingerprint of <https://github.com/pantsbuild/pex/releases/download/v2.1.62/pex> verified.
Installing pantsbuild.pants==2.12.0 into a virtual environment at /Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.12.0_py37
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==2.12.0 (from versions: 0.0.17, 0.0.18, 0.0.20, 0.0.21, 0.0.22, 0.0.23, 0.0.24, 0.0.25, 0.0.26, 0.0.27, 0.0.28, 0.0.29, 0.0.30, 0.0.31, 0.0.32, 0.0.33, 0.0.34, 0.0.35, 0.0.36, 0.0.37, 0.0.38, 0.0.39, 0.0.40, 0.0.41, 0.0.42, 0.0.43, 0.0.44, 0.0.45, 0.0.46, 0.0.47, 0.0.48, 0.0.49, 0.0.50, 0.0.51, 0.0.52, 0.0.53, 0.0.54, 0.0.55, 0.0.56, 0.0.57, 0.0.58, 0.0.59, 0.0.60, 0.0.61, 0.0.62, 0.0.63, 0.0.64, 0.0.65, 0.0.66, 0.0.67, 0.0.68, 0.0.69, 0.0.70, 0.0.71, 0.0.72, 0.0.73, 0.0.74, 0.0.75, 0.0.76, 0.0.77, 0.0.79, 0.0.80, 0.0.81, 0.0.82, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.15.0, 1.16.0, 1.17.0, 1.18.0, 1.19.0, 1.20.0, 1.21.0, 1.22.0, 1.23.0, 1.24.0, 1.25.0, 1.26.0, 1.27.0, 1.28.0, 1.29.0, 1.30.0, 1.30.1, 1.30.2, 1.30.3, 1.30.4, 1.30.5rc1, 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.4.0, 2.4.1, 2.4.2)
ERROR: No matching distribution found for pantsbuild.pants==2.12.0
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
Based on the error message, I figured something in my setup is not compatible with pants version 2.12.0 and changed the version in the
pants.toml
file to
2.4.0
but to no avail. It did not bootstrap and started giving other errors:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
Bootstrapping Pants using /opt/anaconda3/envs/pants/bin/python3.7
Installing pantsbuild.pants==2.4.0 into a virtual environment at /Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37
New virtual environment successfully created at /Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37.
23:25:08.23 [INFO] initializing scheduler...
Traceback (most recent call last):
File "/Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37/lib/python3.7/site-packages/pants/init/extension_loader.py", line 128, in load_backend
module = importlib.import_module(backend_module)
File "/opt/anaconda3/envs/pants/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pants.backend.experimental'
23:25:08.30 [ERROR] Failed to load the pants.backend.experimental.python.lint.autoflake.register backend: ModuleNotFoundError("No module named 'pants.backend.experimental'")
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
I removed the backend
'pants.backend.experimental'
that the error pointed at but received error for another backend:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
23:25:40.91 [INFO] initializing scheduler...
Traceback (most recent call last):
File "/Users/dheerajramchandani/.cache/pants/setup/bootstrap-Darwin-x86_64/2.4.0_py37/lib/python3.7/site-packages/pants/init/extension_loader.py", line 128, in load_backend
module = importlib.import_module(backend_module)
File "/opt/anaconda3/envs/pants/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pants.backend.plugin_development'
23:25:40.99 [ERROR] Failed to load the pants.backend.plugin_development.register backend: ModuleNotFoundError("No module named 'pants.backend.plugin_development'")
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
23:26:05.25 [INFO] initializing scheduler...
23:26:05.96 [INFO] scheduler initialized.
23:26:05.99 [ERROR] Invalid scope [python] in /Users/dheerajramchandani/pants-training/pants.toml
23:26:05.99 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
Finally, after removing this backend I received the following error which is not much helpful:
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$ ./pants --version
23:26:05.25 [INFO] initializing scheduler...
23:26:05.96 [INFO] scheduler initialized.
23:26:05.99 [ERROR] Invalid scope [python] in /Users/dheerajramchandani/pants-training/pants.toml
23:26:05.99 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)
(Use --print-stacktrace to see more error details.)
(pants) Dheerajs-MacBook-Pro:pants-training dheerajramchandani$
Why does it say invalid scope for [python]? I have used this scope with pants v1 and with v2.12 and it bootstrapped fine. Was this scope removed sometime after v1 and reintroduced after 2.4.0? Could anyone please help me bootstrap pants with version 2.12.0?
7 Views