witty-house-77262
08/05/2021, 3:56 PMpipx install pants
-> failed, with some hints that this was not the right pants
package.
Second try: pipx install pantsbuild.pants
-> failed, with the following error:
~/ghq/github.com/pantsbuild/example-python main pipx install pantsbuild.pants ✘ 1 34s 17:44:33
Fatal error from pip prevented installation. Full pip output in file:
/Users/fermigier/.local/pipx/logs/cmd_2021-08-05_17.49.52_pip_errors.log
pip failed to build package:
Markdown
Some possibly relevant errors from pip install:
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
AttributeError: 'HTMLParser' object has no attribute 'unescape'
Error installing pantsbuild-pants.
Third try, after reading the documentation:
~/tmp/pants curl -L -o ./pants <https://pantsbuild.github.io/setup/pants> && \ ✔ 17:52:14
chmod +x ./pants
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 162 100 162 0 0 6812 0 --:--:-- --:--:-- --:--:-- 7043
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 13595 100 13595 0 0 67103 0 --:--:-- --:--:-- --:--:-- 67103
~/tmp/pants printf '[GLOBAL]\npants_version = "2.6.0"\n' > pants.toml ✔ 17:52:16
~/tmp/pants ls ✔ 17:52:22
pants pants.toml
~/tmp/pants ./pants ✔ 17:52:23
Bootstrapping Pants using /Users/fermigier/.pyenv/shims/python3.9
Installing pantsbuild.pants==2.6.0 into a virtual environment at /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/2.6.0_py39
created virtual environment CPython3.9.6.final.0-64 in 561ms
creator CPython3Posix(dest=/Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.s3V8wr/install, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/fermigier/Library/Application Support/virtualenv)
added seed packages: pip==21.1.3, setuptools==57.1.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Requirement already satisfied: pip in /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.s3V8wr/install/lib/python3.9/site-packages (21.1.3)
Collecting pip
Using cached pip-21.2.2-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.1.3
Uninstalling pip-21.1.3:
Successfully uninstalled pip-21.1.3
Successfully installed pip-21.2.2
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==2.6.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)
ERROR: No matching distribution found for pantsbuild.pants==2.6.0
Is there a way to fix this installation problem ?
Also, I’d like to know if installing pants globally (using pip
or pipx
) will be supported ? (I’d rather type pants ...
than ./pants ...
).hundreds-father-404
08/05/2021, 4:02 PMproud-dentist-22844
08/05/2021, 4:06 PM~/.zprofile
or ~/.zshrc
(or ~/.bashrc
if you’re using bash instead of the zsh default on Mac):
alias pants='./pants'
witty-house-77262
08/05/2021, 4:23 PMwitty-house-77262
08/05/2021, 4:24 PMwitty-house-77262
08/05/2021, 4:24 PMERROR: Could not find a version that satisfies the requirement pantsbuild.pants==2.6.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)
hundreds-father-404
08/05/2021, 4:26 PMset -x
to the top of the bash script and copy the output into here? I'm suspecting it's trying to use an incorrect Python version perhapshundreds-father-404
08/05/2021, 4:27 PMwitty-house-77262
08/05/2021, 4:30 PM~/ghq/github.com/pantsbuild/example-python main !1 ./pants ✔ 4s 18:30:10
+ set -eou pipefail
+ PYTHON_BIN_NAME=unspecified
+ PANTS_TOML=pants.toml
+ PANTS_BIN_NAME=./pants
+ PANTS_SETUP_CACHE=/Users/fermigier/.cache/pants/setup
+ [[ /Users/fermigier/.cache/pants/setup != /* ]]
++ uname -s
++ uname -m
+ PANTS_BOOTSTRAP=/Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64
+ PEX_VERSION=2.1.42
+ PEX_URL=<https://github.com/pantsbuild/pex/releases/download/v2.1.42/pex>
+ PEX_EXPECTED_SHA256=69d6b1b1009b00dd14a3a9f19b72cff818a713ca44b3186c9b12074b2a31e51f
+ VIRTUALENV_VERSION=20.4.7
++ cat
+ VIRTUALENV_REQUIREMENTS='virtualenv==20.4.7 --hash sha256:2b0126166ea7c9c3661f5b8e06773d28f83322de7a3ff7d06f0aed18c9de6a76
filelock==3.0.12 --hash sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836
six==1.16.0 --hash sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
distlib==0.3.2 --hash sha256:23e223426b28491b1ced97dc3bbe183027419dfc7982b4fa2f05d5f3ff10711c
appdirs==1.4.4 --hash sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128
importlib-resources==5.1.4; python_version < "3.7" --hash sha256:e962bff7440364183203d179d7ae9ad90cb1f2b74dcb84300e88ecc42dca3351
importlib-metadata==4.5.0; python_version < "3.8" --hash sha256:833b26fb89d5de469b24a390e9df088d4e52e4ba33b01dc5e0e4f41b81a16c00
zipp==3.4.1; python_version < "3.10" --hash sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098
typing-extensions==3.10.0.0; python_version < "3.8" --hash sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84'
+ COLOR_RED='\x1b[31m'
+ COLOR_GREEN='\x1b[32m'
+ COLOR_RESET='\x1b[0m'
+++ dirname ./pants
++ cd .
++ pwd -P
+ cd /Users/fermigier/ghq/github.com/pantsbuild/example-python
++ determine_pants_version
++ '[' -n '' ']'
+++ get_pants_config_value pants_version
+++ local config_key=pants_version
+++ local 'optional_space=[[:space:]]*'
+++ local 'prefix=^pants_version[[:space:]]*=[[:space:]]*'
+++ local raw_value
++++ sed -ne '/^pants_version[[:space:]]*=[[:space:]]*/ s#^pants_version[[:space:]]*=[[:space:]]*##p' pants.toml
+++ raw_value='"2.6.0"'
+++ echo '"2.6.0"'
+++ tr -d '"'\'''
+++ return 0
++ pants_version=2.6.0
++ [[ -z 2.6.0 ]]
+++ echo 2.6.0
+++ cut -d . -f1
++ pants_major_version=2
+++ echo 2.6.0
+++ cut -d . -f2
++ pants_minor_version=6
++ [[ 2 -eq 1 ]]
++ echo 2.6.0
+ pants_version=2.6.0
++ determine_python_exe 2.6.0
++ local pants_version=2.6.0
++ set_supported_python_versions 2.6.0
++ local pants_version=2.6.0
++ local pants_major_version
++ local pants_minor_version
+++ echo 2.6.0
+++ cut -d . -f1
++ pants_major_version=2
+++ echo 2.6.0
+++ cut -d . -f2
++ pants_minor_version=6
++ [[ 2 -eq 1 ]]
++ [[ 2 -eq 2 ]]
++ [[ 6 -eq 0 ]]
++ [[ 2 -eq 2 ]]
++ [[ 6 -eq 1 ]]
++ [[ 2 -eq 2 ]]
++ [[ 6 -lt 5 ]]
++ supported_python_versions_decimal=('3.9' '3.8' '3.7')
++ supported_python_versions_int=('39' '38' '37')
++ supported_message='3.7, 3.8, or 3.9'
++ local 'requirement_str=For `pants_version = "2.6.0"`, Pants requires Python 3.7, 3.8, or 3.9 to run.'
++ local python_bin_name
++ [[ unspecified != \u\n\s\p\e\c\i\f\i\e\d ]]
+++ determine_default_python_exe
+++ for version in '"${supported_python_versions_decimal[@]}"'
+++ local interpreter_path
++++ command -v python3.9
+++ interpreter_path=/Users/fermigier/.pyenv/shims/python3.9
+++ [[ -z /Users/fermigier/.pyenv/shims/python3.9 ]]
++++ /Users/fermigier/.pyenv/shims/python3.9 --version
+++ [[ '' == \p\y\e\n\v\:\ \p\y\t\h\o\n\3\.\9* ]]
+++ echo /Users/fermigier/.pyenv/shims/python3.9
+++ return 0
++ python_bin_name=/Users/fermigier/.pyenv/shims/python3.9
++ [[ -z /Users/fermigier/.pyenv/shims/python3.9 ]]
++ local python_exe
+++ get_exe_path_or_die /Users/fermigier/.pyenv/shims/python3.9
+++ local exe=/Users/fermigier/.pyenv/shims/python3.9
+++ command -v /Users/fermigier/.pyenv/shims/python3.9
++ python_exe=/Users/fermigier/.pyenv/shims/python3.9
++ local major_minor_version
+++ get_python_major_minor_version /Users/fermigier/.pyenv/shims/python3.9
+++ local python_exe=/Users/fermigier/.pyenv/shims/python3.9
+++ /Users/fermigier/.pyenv/shims/python3.9
++ major_minor_version=39
++ for valid_version in '"${supported_python_versions_int[@]}"'
++ [[ 39 == \3\9 ]]
++ echo /Users/fermigier/.pyenv/shims/python3.9
++ return 0
+ python=/Users/fermigier/.pyenv/shims/python3.9
++ bootstrap_pants 2.6.0 /Users/fermigier/.pyenv/shims/python3.9 ''
++ local pants_version=2.6.0
++ local python=/Users/fermigier/.pyenv/shims/python3.9
++ local pants_sha=
++ local pants_requirement=pantsbuild.pants==2.6.0
++ local maybe_find_links
++ [[ -z '' ]]
++ maybe_find_links=
++ local python_major_minor_version
+++ get_python_major_minor_version /Users/fermigier/.pyenv/shims/python3.9
+++ local python_exe=/Users/fermigier/.pyenv/shims/python3.9
+++ /Users/fermigier/.pyenv/shims/python3.9
++ python_major_minor_version=39
++ local target_folder_name=2.6.0_py39
++ local bootstrapped=/Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/2.6.0_py39
++ [[ ! -d /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/2.6.0_py39 ]]
++ green 'Bootstrapping Pants using /Users/fermigier/.pyenv/shims/python3.9'
++ (( 1 > 0 ))
++ log '\x1b[32mBootstrapping Pants using /Users/fermigier/.pyenv/shims/python3.9\x1b[0m'
++ echo -e '\x1b[32mBootstrapping Pants using /Users/fermigier/.pyenv/shims/python3.9\x1b[0m'
Bootstrapping Pants using /Users/fermigier/.pyenv/shims/python3.9
++ local staging_dir
+++ tempdir /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64
+++ mkdir -p /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64
+++ mktemp -d /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.XXXXXX
++ staging_dir=/Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.q9BKHl
++ local virtualenv_path
+++ bootstrap_virtualenv /Users/fermigier/.pyenv/shims/python3.9
+++ local python=/Users/fermigier/.pyenv/shims/python3.9
+++ local bootstrapped=/Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/virtualenv-20.4.7/virtualenv.pex
+++ [[ ! -f /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/virtualenv-20.4.7/virtualenv.pex ]]
+++ echo /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/virtualenv-20.4.7/virtualenv.pex
++ virtualenv_path=/Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/virtualenv-20.4.7/virtualenv.pex
++ green 'Installing pantsbuild.pants==2.6.0 into a virtual environment at /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/2.6.0_py39'
++ (( 1 > 0 ))
++ log '\x1b[32mInstalling pantsbuild.pants==2.6.0 into a virtual environment at /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/2.6.0_py39\x1b[0m'
++ echo -e '\x1b[32mInstalling pantsbuild.pants==2.6.0 into a virtual environment at /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/2.6.0_py39\x1b[0m'
Installing pantsbuild.pants==2.6.0 into a virtual environment at /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/2.6.0_py39
++ /Users/fermigier/.pyenv/shims/python3.9 /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/virtualenv-20.4.7/virtualenv.pex --no-download /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.q9BKHl/install
created virtual environment CPython3.9.6.final.0-64 in 631ms
creator CPython3Posix(dest=/Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.q9BKHl/install, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/fermigier/Library/Application Support/virtualenv)
added seed packages: pip==21.1.3, setuptools==57.1.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
++ /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.q9BKHl/install/bin/pip install -U pip
Requirement already satisfied: pip in /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.q9BKHl/install/lib/python3.9/site-packages (21.1.3)
Collecting pip
Using cached pip-21.2.2-py3-none-any.whl (1.6 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 21.1.3
Uninstalling pip-21.1.3:
Successfully uninstalled pip-21.1.3
Successfully installed pip-21.2.2
++ /Users/fermigier/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.q9BKHl/install/bin/pip install --progress-bar off pantsbuild.pants==2.6.0
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==2.6.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)
ERROR: No matching distribution found for pantsbuild.pants==2.6.0
++ exit 1
+ pants_dir=
+ exit 1
witty-house-77262
08/05/2021, 4:32 PMhundreds-father-404
08/05/2021, 4:35 PMCPython3.9.6.final.0-64
. It looks like you're using pyenv
, could you please run pyenv global
?
Another option is to try running Pants w/ another Python interpreter by setting the env var PYTHON=python3.8
for example. Even if that's not going to be the permanent solution, it could help to debugwitty-house-77262
08/05/2021, 4:38 PMwitty-house-77262
08/05/2021, 4:38 PMwitty-house-77262
08/05/2021, 4:39 PMPYTHON=python3.8
I get a different error:witty-house-77262
08/05/2021, 4:39 PMhundreds-father-404
08/05/2021, 4:44 PMhundreds-father-404
08/05/2021, 4:45 PMwitty-house-77262
08/05/2021, 4:47 PMwitty-house-77262
08/05/2021, 4:47 PMwitty-house-77262
08/05/2021, 4:48 PMrustc
installed).hundreds-father-404
08/05/2021, 4:51 PMhundreds-father-404
08/05/2021, 4:59 PMhappy-kitchen-89482
08/30/2021, 11:31 PM