Installing Python
Notes// archive From the original Code Walker docs. Kept for reference, so some versions and commands may be out of date.
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:
mkdir ~/Python && cd ~/Pythonwget https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tar.xztar -xvf Python-3.11.9.tar.xzChanging into the Python directory ready to compile:
cd Python-3.11.9If 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:
useradd -aG sudo richardInstall the following packages needed for compiling Python:
sudo apt install build-essentialsudo dnf install dnf-utils make gcc openssl-devel bzip2-devel libffi-devel zlib-devel sqlite-develNext 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-optimizationsNow start the build process, the-jflag exploits multicore processors for fast build times.
make -j $(nproc)Finally install Python along side existing version using altinstall and avoid overwriting existing Python3 binaries.
sudo make altinstallAll being well, you should now have two versions Python available, the default system version:
python3 -V
Python 3.12.3And the one you just installed:
python3.11 -V
Python 3.11.5