pants: Python 3.10 is not supported for running the Pants script itself
~/example-golang$ ./pants
No valid Python interpreter found. For `pants_version = "2.9.0.dev3"`, Pants requires Python 3.7, 3.8, or 3.9 to run. Please check that a valid interpreter is installed and on your $PATH.
$ python --version
Python 3.10.1
Maintainer edit:
Note that Pants can still run your own code using Python 3.10, this is only about what Pants uses to run itself. See https://www.pantsbuild.org/docs/python-interpreter-compatibility.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 6
- Comments: 21 (14 by maintainers)
Note that Ubuntu 22.04 LTS ships with Python 3.10
so to run Pants one needs to install older Python from an alternative channel, like in example https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
in case it affects priority of supporting it. thanks 🙏
Chiming in that current active Fedora versions 35 and 36 ship with Python 3.10 as stock too
This means that for users of these distro versions (as well as Ubuntu 22.04 mentioned above), Pants is not usable “out of the box”. It requires a separate step to install an older version of Python that Pants can discover.
So yes, it’s an implementation detail, but it’s one that users must deal with.
We are pretty close to having “rust embeds python” working! It should be out for code review today.
For those looking to decouple their system Python from the version that
pantsuses, you’ll want to move to scie-pants. The new installation documentation talks about how to do this.Largely thanks to @twunderlich-grapl bumping this issue in Slack, I started a poll yesterday:
13 upvotes, 0 downvotes. I’ll give it until Monday, but think there’s enough consensus for us to target Pants 2.14 being released with Python 3.8-3.10 🎉
@benjyw @Eric-Arellano @stuhood I haven’t been following the “rust embeds python” work to know the current progress, but this has started to bite us at Color. Is it too late to add 3.10 support for 2.15.x? If so, could we set it up for 2.16.x? Especially now that 3.11 has an official release 😅
(I’m happy / available to take on the work if you’re 👍 to it)
I agree that “rust embeds python” (aka standalone binary) is the end state we want to get to. There is still work to be done there though.
And, to clarify, this just means that Pants requires 3.7, 3.8 or 3.9 in order to run itself. But it can build your Python code (if you have any) at any version of Python.
Thanks for the report! For now though, the message is accurate:
Pantsincludes native code, and is only built for3.7,3.8, and3.9. I’ll keep this open to track Pants being published for more versions.