To install Python 3.8 on Debian, you can follow these steps:
-
Make sure your Debian system has been updated to the latest version, you can use the following command to update:
sudo apt update sudo apt upgrade
-
Install the dependencies for Python 3.8, as well as the tools and libraries needed to build Python:
sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev
-
Download the source code package for Python 3.8:
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz
-
Unzip the source code package:
tar -xf Python-3.8.12.tgz
-
Enter the decompressed directory:
cd Python-3.8.12
-
Configure Python compilation options:
./configure --enable-optimizations
-
Compile and install Python:
make -j 4 sudo make altinstall
Note: Use
make altinstall
the command instead ofmake install
the command to avoid overwriting the Python version that comes with the system. -
Once installed, you can check your Python version with the following command:
python3.8 --version
If
Python 3.8.12
the output is similar to , then Python 3.8 has been successfully installed on your Debian system.