How To Install Python 3.9 on Debian 10

Python is an object-oriented, high-level programming language. It is an open source with a large community. Python is used as key languages among the top tech companies like Google. The Python 3.9 stable version has been released with several improvements and security updates. It included multiple new modules, improved existing modules and many other features.

Debian 10 default repositories comes with Python 3.7. So if your application can work with this version, install it from default repositories using command apt install python3 . To install Python 3.9 on Debian 10 follow this tutorial.

This tutorial will described you to install Python 3.9 on Debian 10 Linux system.

Prerequisites

Login to the Debian system with sudo privileged account access. Open a terminal (CTRL+ALT+T) and execute below commands to update packages.

sudo apt update && sudo apt upgrade 

Then install the required packages for the compilation of Python source code.

sudo apt install wget build-essential libreadline-gplv2-dev libncursesw5-dev 
     libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev  

Install Python 3.9 on Debian

The default Debian repositries contains Python 3.7 only. So this tutorial will use Python source code for installation on Debain 10 system.

Follow the below steps to install Python 3.9 on Debian:

  1. Download Python – You can directory download Python 3.9 source archive from its official site.
    wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz 
    
  2. Extract Archive – You can directory download Python 3.9 source archive from its official site.
    tar xzf Python-3.9.1.tgz 
    
  3. Compile Python Source – You can directory download Python 3.9 source archive from its official site.
    cd Python-3.9.1 
    ./configure --enable-optimizations 
    
  4. Install Python 3.9 – You can directory download Python 3.9 source archive from its official site.
    make altinstall 
    

Wait for the Python installation complete on your system.

Check Python Version

At this step, you have successfully installed Python 3.9 on Debian 10 system. You need to type python3.9 to use this version. For example, to check the Python version, execute:

python3.9 -V 

Python 3.9.1

This will also install pip for Python 3.9.

pip3.9 -V 

pip 20.2.3 from /usr/local/lib/python3.9/site-packages/pip (python 3.9)

That’s it, You have successfully installed Python 3.9 on Debian 10 system.

Conclusion

In this tutorial, you have learned to install Python 3.9 on Ubuntu 20.04 using Apt and source code. You can try Python examples via command line.

The post How To Install Python 3.9 on Debian 10 appeared first on TecAdmin.

Debian Debian 10 Python Python3 Python3.9 TecAdmin