- For compiling the source code install essential packages. (If you haven't done this before)
sudo apt install wget build-essential checkinstall
sudo apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
sudo apt install zlib1g-dev
sudo apt install zlib1g zlib1g-dev libssl-dev libbz2-dev libsqlite3-dev
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git
sudo apt install libedit-dev libnss3-dev
- Download Python 3.11 source code from the official download site in the Desktop.
sudo wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tgz
- Extract the downloaded archive file and prepare the source for the installation.
tar xzf Python-3.11.0.tgz
cd Python-3.11.0
sudo ./configure --enable-optimizations
- Now, install Python 3.11 on your system.
make -j 8
sudo make altinstall
- Verify the installed version:
python3.11 --version