apologies in advance for the random support questi...
# general
h
apologies in advance for the random support question, but for whatever reason i’m not able to install the latest version of
pantsbuild.pants
. i’m on a clean M1 Pro macbook pro with barely anything installed so far (essentially just homebrew, pyenv, poetry, and python):
Copy code
martim@Argon allpdl % poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing pantsbuild.pants (2.7.0): Failed

  RuntimeError

  Unable to find installation candidates for pantsbuild.pants (2.7.0)

  at ~/.poetry/lib/poetry/installation/chooser.py:72 in choose_for
       68│ 
       69│             links.append(link)
       70│ 
       71│         if not links:
    →  72│             raise RuntimeError(
       73│                 "Unable to find installation candidates for {}".format(package)
       74│             )
       75│ 
       76│         # Get the best link

martim@Argon allpdl % ./pants -V
Bootstrapping Pants using /Users/martim/.pyenv/shims/python3
Installing pantsbuild.pants==2.7.0 into a virtual environment at /Users/martim/.cache/pants/setup/bootstrap-Darwin-arm64/2.7.0_py38
created virtual environment CPython3.8.10.final.0-64 in 140ms
  creator CPython3Posix(dest=/Users/martim/.cache/pants/setup/bootstrap-Darwin-arm64/pants.317fyy/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/martim/Library/Application Support/virtualenv)
    added seed packages: pip==21.1.2, setuptools==57.0.0, wheel==0.36.2
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Requirement already satisfied: pip in /Users/martim/.cache/pants/setup/bootstrap-Darwin-arm64/pants.317fyy/install/lib/python3.8/site-packages (21.1.2)
Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.1.2
    Uninstalling pip-21.1.2:
      Successfully uninstalled pip-21.1.2
Successfully installed pip-21.3.1
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants==2.7.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)
ERROR: No matching distribution found for pantsbuild.pants==2.7.0
any clue what the issue might be? 😕
a
I had the same problem a couple of times and I solved it by updating pip
h
unfortunately that didn’t seem to work 😞
Copy code
martim@Argon allpdl % pip -V
pip 21.1.1 from /Users/martim/.pyenv/versions/3.8.10/lib/python3.8/site-packages/pip (python 3.8)
martim@Argon allpdl % pip install --upgrade pip
Requirement already satisfied: pip in /Users/martim/.pyenv/versions/3.8.10/lib/python3.8/site-packages (21.1.1)
Collecting pip
  Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.1.1
    Uninstalling pip-21.1.1:
      Successfully uninstalled pip-21.1.1
Successfully installed pip-21.3.1
martim@Argon allpdl % pip -V
pip 21.3.1 from /Users/martim/.pyenv/versions/3.8.10/lib/python3.8/site-packages/pip (python 3.8)
martim@Argon allpdl % ./pants -V                   
Bootstrapping Pants using /Users/martim/.pyenv/shims/python3
Installing pantsbuild.pants==2.7.0 into a virtual environment at /Users/martim/.cache/pants/setup/bootstrap-Darwin-arm64/2.7.0_py38
...
ERROR: No matching distribution found for pantsbuild.pants==2.7.0
martim@Argon allpdl % poetry install
Installing dependencies from lock file

Package operations: 1 install, 0 updates, 0 removals

  • Installing pantsbuild.pants (2.7.0): Failed

  RuntimeError
...
h
Hm, so the wheel is there: https://pypi.org/project/pantsbuild.pants/2.7.0/#files One important thing is that python 3.9 needs to be used, not 3.8 or anything. Have you updated the pants bash script recently? It was updated a few months ago to default to 3.9 to handle this exact issue https://www.pantsbuild.org/docs/installation
h
@hundreds-father-404 ok, i think i figure out the problem then: our monorepo only supports python 3.8, so we set it to use 3.8 globally using
pyenv global 3.8.10
. this causes a problem with pants since it tries to use 3.8 instead of 3.9 (
python@3.9
was installed using homebrew and
python3.9
is available) we’ll look into adding support for python 3.9, but is there an easy way to set the default python version to 3.8 while still allowing pants to use python3.9?
h
Yeah, there are two parts here: • what interpreter Pants uses to run itself, which is controlled by the
./pants
bash script. You can set the env var
PYTHON
to be something like
python3.9
to force it to use py39. This will mean that Pants should install on your machine • what interpreter Pants uses to run your code, which is controlled by
[python-setup].interpreter_constraints
. You can set the env var
PANTS_PYTHON_SETUP_INTERPRETER_CONSTRAINTS='["==3.9.*']
to use Py39 on your machine while coworkers stick to 3.8
You definitely will have to use Py39 for the first part - we only release Pants with Py39 The second part, you could maybe try have Pants use Py38 and get away with it. On my M1, I have issues with Py38 and have to use Py39 tho
👍 1
h
thanks, it sounds like the easiest path forward might be to start upgrading to 3.9 then. hopefully that won’t be too difficult
h
🤞 3.8->3.9 is much less painful than say 2.7->3.5 hehe
😅 1
h
edit: removing this message to reduce noise, error was the same as the one before this thread
h
Yes, in fact! See the thread immediately above this one
h
oh nice! 😂