• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install Python 3.7 on Debian 9

Written by Admin, Updated On May 7, 2020
debian, python
How to Install Python on Debian 9

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.

Prerequisites#

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.

cd Python-3.7.3
./configure --enable-optimizations

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 user:

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:

python3.7 --version
Output
Python 3.7.3

Conclusion#

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.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install Pip on CentOS 7
Next Article   How to Install Sublime Text 3 on CentOS 7

Related Posts

  • How to Install WordPress with Nginx on Debian 11

    How to Install WordPress with Nginx on Debian 11

    March 22, 2023
  • How to Install and Use Docker on Debian 11

    How to Install and Use Docker on Debian 11

    March 10, 2023
  • How to Install MariaDB on Debian 11 Bullseye

    How to Install MariaDB on Debian 11 Bullseye

    March 8, 2023

Leave a Reply Cancel reply

DigitalOcean Referral Badge

Popular Posts

  • How to Install Microsoft Edge Browser on Ubuntu 22.04
    How to Install Microsoft Edge Browser on Ubuntu 22.04 March 14, 2023
  • How to Install Ruby on Ubuntu 22.04 LTS
    How to Install Ruby on Ubuntu 22.04 LTS February 27, 2023
  • How to Install LEMP Stack on Ubuntu 22.04
    How to Install LEMP Stack on Ubuntu 22.04 March 18, 2023
  • How to Install Set Up Apache Virtual Hosts on Ubuntu 22.04
    How to Set Up Apache Virtual Hosts on Ubuntu 22.04 March 2, 2023
  • How to Install MariaDB on Debian 11 Bullseye
    How to Install MariaDB on Debian 11 Bullseye March 8, 2023
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook