Python is popular programming language in the world. Python is a versatile programming language and you can use it to write small scripts, build games, develop websites, create machine learning algorithms, analyze data and more.
Right now Python 2 is active and well supported but Python 3 is considered to be the present and future of the language. Currently, Python 3.7 is the latest major release of the Python language which includes many new features.
Many popular applications and websites including YouTube, DropBox, Reddit, Quora, Instagram, Pinterest have been developed using Python. In this tutorial, described how to install python 3.7 on Debian 9 system.
Before you start installing Python 3.7 on Debian 9, you should have non-root user account with administrative privileges.
Install Python 3.7 on Debian
There are very easy steps to install Python 3.7 on your Debian 9 system. Follow the below steps:
At first, you should update package index list by typing:
sudo apt update
Next, install the necessary packages to build Python source:
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
After that, you have to download latest release source code from the Python download page using wget or curl command:
curl -O https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
Once the download has been finished, extract the tarball:
tar -xf Python-3.7.3.tar.xz
Now run the configure script from python source directory that will do number of checks that all dependencies are installed correctly on your system.
You should run make command to start the build process:
make -j 4
You have to modify
-j flag as per your system’s processor cores. My system has 4 cores, so I am using the
-j 4 flag.
On completion of build, now install Python binaries by executing following command as
sudo make altinstall
That’s all. Python 3.7 is installed on your Debian 9 system and ready to be used. If you want, you can verify it by typing:
You have successfully installed Python 3.7 on your Debian 9 machine. You can also install third-party modules with Pip and develop your Python 3 project.
If you have any questions or suggestion, please leave a comment below.
Leave a Reply