Hi, I'm having some problems with running the `pan...
# general
a
Hi, I'm having some problems with running the
pants package
goal against either Dockerfiles or Python packages. I'm on version 2.17. My system Python is 3.10.12, but my project uses pyenv (Python 3.10.13). I am able to
pants generate-lockfiles ::
with no problems. Whenever I run the
package
or
run
goals it gets stuck on
⠲ 377.49s Find interpreter for constraints: CPython<3.11,>=3.10.0
The time keeps going up and nothing is happening. Annoyingly, this stuff all works with the same repo on my other laptop. How can I go about debugging and fixing this issue?
1
1
I've figured this out now. I suspect Pants couldn't find Python on my default
$PATH
I updated my
pants.toml
to use Pyenv instead of looking in
$PATH
https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path
h
Definitely better to use pyenv than system interpreters or brew-installed ones
Probably it found an interpreter on your path that blocked when run (Apple does weird shim stuff with its system interpreters, it may have blocked on a license acceptance or something)
As of 2.16 Pants can automatically bootstrap a compatible intepreter for you. Just add
pants.backend.python.providers.experimental.pyenv
to your
backend_packages
.
a
Wow, that's a cool feature, I'll check that out.