Python is an easy to learn, powerful programming language. It has efficient high-level data structures and a simple but effective approach to object-oriented programming. Python’s elegant syntax and dynamic typing, together with its interpreted nature, make it an ideal language for scripting and rapid application development in many areas on most platforms.
This post will help you to how to install Python 3.10 on Ubuntu, Debian, and Linux Mint systems using source code.
First of all, i will login to Debian-based system with sudo privileged account access. Open a terminal and execute the 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
Installing Python 3.10 with Source Code
Download the latest Python version source code from the official websites. Then compile the source code for your system and install it.
Follow the below steps to install Python 3.10 on Debian systems:
Step 1. You can directory download Python 3.10 source archive from its official site or use below command.
$ wget https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz
Step 2. Once the download is completed, extract the archive file on your system.
$ tar xzf Python-3.10.2.tgz
Step 3. Change to the extracted directory with cd command, then prepare the Python source code for the compilation on your system.
$ cd Python-3.10.2
$ ./configure --enable-optimizations
Step 4. Finally, run the following command to complete the Python installation on the Debian system. The altinstall prevents the compiler to override default Python versions.
$ make altinstall
Wait for the end of Python installation.
Now at end Check Python Version
If you have successfully installed Python 3.10 on Ubuntu or Debian system. You need to type python3.10 to use this version.
$ python3.10 -V
This will also install pip for Python 3.10.
$ pip3.10 -V
And Finally , You have successfully installed Python 3.10 on Ubuntu, Debian, or the Linux Mint system.