Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Python 3.9 on Debian 10 - DesignLinux

Dec 24 2020
designlinux 0 Comments
How to Install Python 3.9 on Debian 10

Python is most popular programming language. It is used by multiple ways to build different kinds of applications. Python 3.9 is the latest major release of the Python language. It includes many new features such as new dict operators, new str functions, support for IANA time zone, and more. This tutorial describes multiple ways to install Python 3.9 on Debian 10 system.

Install Python 3.9 on Debian with Apt#

It’s very simple and straightforward process to install Python 3.9 on Debian using the apt packages manager.

Step 1 – Update packages list#

First, update the packages list and install required dependencies:

sudo apt update
sudo apt install software-properties-common

Step 2 – Enable Repository#

After that add the deadsnakes PPA to your system’s sources list by typing:

sudo add-apt-repository ppa:deadsnakes/ppa

Hit the Enter when you get prompt.

Step 3 – Install Python 3.9#

Once the repository enabled you can install the Python 3.9 by runnig below command:

sudo apt update
sudo apt install python3.9

Step 4 – Verify Installation#

To verify the installation, you would type:

python3.9 --version
Python 3.9.0+

At this stage, the Python 3.9 is installed on your Debian 10 system.

Install Python 3.9 on Debian from Source#

You can install the latest version of Python and customize the build options by compiling the Python from source. Below are the steps to install Python 3.9 from Python source:

Step 1 – Install dependencies#

You should install the required dependencies to build python. Run the following commands:

sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev

Step 2 – Download source code#

After that download the latest source code from Python download page using wget:

wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz

Once the download is finished, extract the tarball:

tar -xf Python-3.9.0.tgz

Step 3 – Configure script#

Navigate to the Python source directory and execute the configure script. It will do few checks that required dependencies are installed.

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

The --enable-optimizations option optimizes the Python binary by running multiple tests. This makes the build process slower.

Step 4 – Start build process#

You would run the following command to start the build process for python:

make -j 12

For faster build time, modify the -j to correspond to the number of cores in your processor. You can find the number by typing nproc.

Step 5 – Install Python#

Once the build process is complete, install the Python binaries by typing:

sudo make altinstall

That’s it. Python 3.9 has been installed from source and ready to be used. Verify the installation by typing:

python3.9 --version
Python 3.9.0+

Conclusion#

This tutorial shows you multiple ways to install Python 3.9 on Debian 10 system. You can read here How to use Pip.

If you have any questions or feedback, leave a comment below.

Related

Tags: debian, python

Listing Linux Services with Systemctl

Prev Post

How to Install Notepad++ on CentOS 8

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 1
  • 1,087
  • 571,442

DesignLinux.com © All rights reserved

Go to mobile version