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

sparse-intern-12190

04/30/2023, 3:30 PM
Hi, I am trying to setup pants on Mac M1. I am getting below error. Bootstrapping Pants using /Users/vikashanand/anaconda3/envs/andromeda/bin/python3.8 Installing pantsbuild.pants==2.12.0 into a virtual environment at /Users/vikashanand/.cache/pants/setup/bootstrap-Darwin-arm64/2.12.0_py38 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) ERROR: No matching distribution found for pantsbuild.pants==2.12.0
Can someone help on this ?
h

happy-kitchen-89482

04/30/2023, 3:39 PM
Pants on M1 requires Python 3.9+ to run itself, due to various issues with earlier Pythons on that hardware.
And I'm not sure it will run on anaconda - we've only tested on regular CPython
I assume from the 2.12.0 that this is an existing repo?
That has a
./pants
script?
I would strongly recommend switching the repo to use the new Pants launcher binary (https://www.pantsbuild.org/docs/installation) which provides its own Python, so you don't need to think about it.
And note that this is unrelated to the version of Python your code uses, which can be anything, this is just about the Python needed to run Pants itself
s

sparse-intern-12190

04/30/2023, 3:44 PM
yes its from an existing repo which already has pants script
h

happy-kitchen-89482

04/30/2023, 3:53 PM
If you have the ability to make that change in your repo it will save you and others so much trouble in the future...
Otherwise, you'll need to install Python 3.9 and ensure it's the one the
./pants
script tries to use
Which is exactly the kind of dance the new
pants
launcher binary avoids
s

sparse-intern-12190

04/30/2023, 4:05 PM
Yes I can upgrade it
I have removed anaconda and installed python with brew command
When I am making the virtual environment, I am still getting the same error
e

enough-analyst-54434

04/30/2023, 4:48 PM
@sparse-intern-12190 you should not be making any virtual environment. Please try the installation method recommended by https://www.pantsbuild.org/docs/installation that Benjy pointed out. That will both ensure there is an appropriate Python interpreter for your platform (it will download a self-contained python distribution) and then use that downloaded interpreter to create an appropriate venv behind the scenes for Pants to use to run in.
There is no need to brew install a Python interpreter.
So, just
brew install pantsbuild/tap/pants
and then, instead of running `./pants`run
pants
.
If that works, then you might download the
get-pants.sh
script and check it into your repo and consider removing the
./pants
script after updating any docs or READMEs you have explaining how to use Pants in your repo.
b

breezy-mouse-20493

04/30/2023, 6:30 PM
Getting to know that Pants doesn't require that we dance around with virtualenv's has been a challenge. Sourcing that venv/bin/activate has been done so many times it's just part of muscle memory!
s

sparse-intern-12190

05/01/2023, 3:12 AM
yes i did it
and it worked
thanks @breezy-mouse-20493 @enough-analyst-54434 @happy-kitchen-89482
4 Views