What is the correct way to use a different version...
# general
p
What is the correct way to use a different version of Python in CI on GitHub self hosted runners? I'm using GitHub actions with pants 2.22.0 and I want to use Python 3.12 which we use locally and in our current polyrepo setup. Trying to use 3.12 fails with
home/runner/_work/_tool/Python/3.12.7/x64/bin/python3.12: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory
I think this is related to https://github.com/actions/setup-python/issues/871 Are there any accepted solutions beyond the workaround in that ticket to do this that people are using? We have the following in
pants.toml
Copy code
[python]
interpreter_constraints = ["==3.12.*"]
pants lint ::
in CI is failing with
Copy code
Error: 2.79 [ERROR] 1 Exception encountered:
Engine traceback:
  in `lint` goal
ProcessExecutionFailure: Process 'Find interpreter for constraints: CPython==3.12.*' failed with exit code 102.
stdout:
stderr:
Could not find a compatible interpreter.
Examined the following working interpreters:
1.) /usr/bin/python3.10 CPython==3.10.12
Skipped the following broken interpreters:
1.) /home/runner/_work/_tool/Python/3.12.7/x64/bin/python3.12:
/home/runner/_work/_tool/Python/3.12.7/x64/bin/python3.12: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory