Hi All, may I ask what should I do if my pants boo...
# general
l
Hi All, may I ask what should I do if my pants bootstraps with wrong version of python? In pants.toml I have:
Copy code
[python]
enable_resolves = true
interpreter_constraints = ["CPython==3.10.*"]
And I have python3.10 installed:
python --version
Python 3.10.12
But when I run any pants command , I got:
Bootstrapping Pants using /usr/bin/python3.8
It worked before, but today after I ran ./pants fmt , it’s broken.
b
Pants itself is a python application. That message is about Pants's own bootstrapping. The constraints you set are for your code, and don't change Pants's own execution
l
Thanks! So how can I force pants to use another python version?
b
You don't. Pants has compiled bits specific to a python version. Is there a reason you want to use a different version?
l
No specific reason, but I’m just curious why it changed python version suddenly. I just upgrade my system python in /usr/bin/python from 3.8 to 3.10 and now pants is using python in
/.pyenv/shims/python3.9
which solved my problem in a weird way...
b
Are you using the
pants
binary launcher? (e.g. not using
./pants
) It downloads and provides Python for Pants (and only Pants)
l
no I'm using ./pants
in a project
b
Ah, then
pants
is for you 🙂 https://www.pantsbuild.org/docs/installation
l
We are using pants check in our pre-commit process, installing the binary launcher won't break it ,right?
b
shouldn't 🙂
l
Got it , thanks!