Hi Pants experts, does Pants support Python 3.10? ...
# general
p
Hi Pants experts, does Pants support Python 3.10? We attempted to upgrade to 3.10.11 and see this error from Pants:
mingshi@C02F65C2MD6T pynest % ./pants roots
`No valid Python interpreter found. For
pants_version = "2.14.0"
, Pants requires Python 3.7, 3.8, or 3.9 to run. Please check that a valid interpreter is installed and on your $PATH.` Appreciate any help in advance!
f
Pants does not but thankfully there is a new way to run Pants which manages the Python version used by Pants.
🙏 1
g
Pants itself requires Python<=3.9, but can be used to develop code for newer versions than that. It might be beneficial to look up the new isolated Pants installer, which embeds a dedicated interpreter. That would likely make your workflows easier as you'd only need host interpreters installed that you're developing for. You can see more about this here: https://www.pantsbuild.org/docs/installation
👍 2
1
p
Thanks a lot!
f
And to amplify @gorgeous-winter-99296’s point, Pants does work with Pants 3.10+ for your user code. This issue was just the version of Pants used by Pants itself.
p
OK
a
Hey folks. Has there been any change on this? From the docs I gather 3.10 is still not a first-class citizen as it comes to running pants itself. Or am I wrong?
b
Pants itself still uses 3.9, but the binary launcher https://www.pantsbuild.org/2.19/docs/getting-started/installing-pants provides the interpreter automagically, so 3.9 doesn’t need to be installed on the system and it is now an implementation detail (Pants 2.18+ requires using this launcher, although the launcher can be used for all versions even before 2.18)
a
Thank you. This should settle us having to provide a correct python version in CI when we migrate to 2.18.
c
as Huon mentioned, you can get this also with pants 2.14 if you use the new pants launcher (scie-pants) instead of the pants bootstrap script.