Installing Python
To get the latest version you can visiting the official Python web site:
https://www.python.org/downloads/.
Then download and extract the Python archive via the command line:
Changing into the Python directory ready to compile:
If you experience issues with sudo with a message such as user is not in the sudoers file, as root you need to add your user to the sudo group, for example:
Install the following packages needed for compiling Python:
Next run the configuration script to prepare your system for the source compilation:
sudo ./configure --with-system-ffi --with-computed-gotos --enable-loadable-sqlite-extensions --enable-optimizations
Now start the build process, the-jflag exploits multicore processors for fast build times.
Finally install Python along side existing version using altinstall and avoid overwriting existing Python3 binaries.
All being well, you should now have two versions Python available, the default system version:
And the one you just installed: