...
- You can download, build and install CPython from sources.
- If you are an Ubuntu user, you could add a third-party repository 'Deadsnakes' and install the missing versions via apt. If you install from Deadsnakes, make sure to also install
python#.#-dev
,python#.#-venv
andpython#
.#-distutils
packages. - You can use PyEnv to download and install Python versions (Recommended).
Installation steps may look as follows:- Follow the steps below in How to setup pyenv.
Install Python intepreter for each supported Python minor version. For example:
Code Block language bash pyenv install 3.7.10 pyenv install 3.8.9 pyenv install 3.9.4 pyenv install 3.10.7
For major.minor.patch versions currently used by Jenkins cluster, see Current Installations.
Make installed interpreters available in your shell by running
Code Block language bash pyenv global 3.8.9 3.7.10 3.9.4 3.10.7
(OPTIONAL) Pyenv will sometimes fail to make these interpreters directly available without a local configuration. If you see errors trying to use
python3.x
, then run alsopyenv local
Code Block language bash pyenv local 3.8.9 3.7.10 3.9.4 3.10.7
After these steps, all python3.x
interpreters should be available in your shell. The first version in the list passed to pyenv global
will be used as default python / python3
interpreter if the minor version is not specified.
...