Install Specific Version of Python

1. Download Python source tarball for your specific version

https://www.python.org/downloads/source/

2. Unpack the tarball and install

1
2
3
4
root@localhost# tar xvf Python-3.10.4.tgz
root@localhost# cd Python-3.10.4
root@localhost# ./configure --enable-optimizations
root@localhost# make altinstall

3. Set the new version by default

For individual user: alias python '/usr/local/bin/python3.10'
For system-wide activation: update-alternatives

4. Check the new installation

1
jim@localhost% python --version