The Wayback Machine - https://web.archive.org/web/20240830103038/https://www.geeksforgeeks.org/how-to-download-and-install-python-latest-version-on-linux/
Open In App

How to Download and Install Python Latest Version on Linux?

Last Updated : 06 Oct, 2021
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Python is a widely-used general-purpose, high-level programming language. This article will serve as a complete tutorial on How to download and install Python latest version on Linux Operating Systems.
On every Linux system including following OS,

  • Ubuntu
  • Linux Mint
  • Debian
  • openSUSE
  • CentOS
  • Fedora
  • and my favourite one, Arch Linux.

You will find Python already installed. You can check it using the following commands from the terminal

$ python --version

To check latest version of python 2.x.x :

$ python2 --version

To check latest version of python 3.x.x :

$ python3 --version

how-to-install-python-on-linux
Clearly it won’t be the latest version of python. There can be multiple methods to install python on a linux base system and it all depends on your linux system.
For almost every Linux system, the following commands would work definitely.

$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install python3.7

Download and install Python Latest Version on Linux

To install latest version from source code of Python follow below steps

Download Python Latest Version from python.org
  • First and foremost step is to open a browser and open
    https://www.python.org/downloads/source/
    how-to-install-python-on-linux-1
  • Underneath the Stable Releases find Download Gzipped source tarball (latest stable release as of now is Python 3.7.4).
  • You can do all the above steps in a single command

    $ wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
    Install Python 3.7.4 Latest Version on Linux

    For installing Python successfully on Linux, Enter Following command to get the prerequisites and other source files

    $ sudo apt-get update
    $ sudo apt-get upgrade
    $ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev  libncursesw5-dev xz-utils tk-dev
    

    Now we are all ready to unpack the file downloaded from the python official website’
    Move to downloads directory using cd downloads in terminal
    and then enter following commands

    $ tar xvf Python-3.6.5.tgz
    $ cd Python-3.6.5
    $ ./configure --enable-optimizations --with-ensurepip=install
    $ make -j 8
    $ sudo make altinstall

    Bingo..!! The latest version of Python language is installed on your Linux system. You can confirm it using below command.

    python --version

    How to set Python 3 as the default version in Linux?

    One can easily install python using various techniques mentioned above in their Linux system. But how to set it as default? so that whenever you enter Python anywhere in the terminal it always executes python3. Here is the simple command from which you can set Python3 as default version.
    Open your terminal and enter,

    sudo alias python = python3

    Now any code executed will automatically get python3 as default version.



Similar Reads

How to download and install Python Latest Version on Windows
Python is a widely-used general-purpose, high-level programming language. This article will serve as a complete tutorial on How to download and install Python latest version on Windows Operating System. Since windows don't come with Python preinstalled, it needs to be installed explicitly. In windows, there is no universal library for installing Py
2 min read
How to download and install Python Latest Version on Android
Python is a widely-used general-purpose, high-level programming language. This article will serve as a complete tutorial on How to download and install Python latest version on Android. Python can run on Android through various apps from the play store library. This tutorial will explain how to run python on Android using Pydroid 3 - IDE for Python
2 min read
Download and Install Python 3 Latest Version
To understand how to Download Python and Install Python You need to know What Python is and where it is actually installed in your system. Let's consider a few points: Python is a widely used general-purpose, high-level programming language. Every Release of Python is open-source. Python releases have also been General Public License (GPL) -compati
4 min read
Download and install pip Latest Version
PIP is a package management system used to install and manage software packages/libraries written in Python. These files are stored in a large “on-line repository” termed as Python Package Index (PyPI). After you have successfully installed Python, you would clearly need pip in order to install packages, such as Numpy, Django and lots more on your
2 min read
Install Python Latest Version on MacOS
Python is a widely used general-purpose, high-level programming language. This article will serve as a complete tutorial on How to download and install Python's latest version on Mac OS. Like Linux, macOS also comes with Python pre-installed on the system. To update to the latest version, we will use the Homebrew Package Manager. It is one of the b
2 min read
How to install OpenCV latest Version?
OpenCV, an open-source computer vision and machine learning software library, is widely used for various image and video processing tasks. Keeping it up-to-date ensures access to the latest features and enhancements. In this article, we will see how we can upgrade the latest Opencv Version in Python. Install the Latest Opencv Version Below are some
1 min read
How to Download Python Old Version and Install
Python is a popular programming language known for its simplicity and versatility. When we install Python in our systems we always install the latest version of it but there may be situations where we need to install an older version of Python due to compatibility reasons or to work on legacy projects so that we can use old features of Python that
2 min read
Update Jupyter Notebook to the Latest Python Version
To take advantage of the latest features and improvements in Python, it is important to keep your Jupyter Notebook updated with the latest Python version. This article will guide you through the process of updating Jupyter Notebook to the latest Python version. Note: Let's say if we want to Download Install from Python 3.7 to 3.11: Checking the Cur
3 min read
Upgrade to the Latest Version of Redis
Redis, a widely-used in-memory data store, constantly evolves with new features and improvements. Upgrading to the latest version of Windows involves specific considerations and steps. In this article, we will guide you through the process of upgrading Redis on a Windows environment, ensuring a smooth transition with minimal disruption. Check the C
1 min read
How to Install Latest ‘Thunderbird’ Email Client in Linux
Thunderbird is a free open-source web-based email, news, and chat client application that can manage numerous email accounts and news feeds. How to install Thunderbird in Linux Step 1: Run the command below on a Kali Linux machine to install this software. sudo apt-get update Step 2: After you've updated the system, run the following command to ins
1 min read
Download and Install Java Development Kit (JDK) on Windows, Mac, and Linux
Setting up a Suitable Development Environment is necessary before one can begin creating Android Applications. It makes it easier for developers to use the tools required to create any Application and ensures that all Operations or Processes run smoothly. Download and Install JDK in order to create Android Application Source Files using the Java or
5 min read
How to check Python Version : Windows, Linux and Mac
Python is a versatile and widely used programming language, and it is used for various tasks, from scripting to web development. Python, like many software, has different versions, and it's important to know which version is installed on your system.  This information is crucial because different Python versions may have variations in syntax or lib
5 min read
How to Hide Nginx Server Version in Linux?
Here we will see how to hide the Nginx server version from error pages and the “Server HTTP” response header field in Linux. This is one of the most important security recommendations for your Nginx HTTP and proxy server. The Nginx will show the version on error pages and in the “Server” response header field. Hiding The Nginx version: To hide the
1 min read
How to Find openSUSE Linux Version?
openSUSE is well known for its GNU/Linux-based operating systems, mainly Tumbleweed, a tested rolling release, and Leap, a distribution with Long-Term-Support(LTS). MicroOS and Kubic are new transactional, self-contained distributions for use as desktop or container runtime. Here we figure out which version of the openSUSE Linux distribution is ins
2 min read
How to Find Out Postfix Mail Server Version in Linux?
The most commonly used implementations of SMTP in most Linux distros are Sendmail and Postfix. Postfix is an open-source mail-transfer agent that was originally developed as an alternative to Sendmail and is usually set up as the default mail server. We'll show you how to figure out what version of the Postfix mail system is running on your Linux s
1 min read
Check the OS Version in Linux
When we want to install the Software on our system, first we must know whether our current Operating System is supporting this version of the software or not. In Windows, we can easily check it as Windows is based on a GUI-based Operating System. But we prefer to use the Command line instead of the GUI in an Operating System like Linus/Unix. In thi
4 min read
How to Download and Install FastStone Capture on Windows?
FastStone Capture is a robust, portable, and feature-rich screen capture and screen recording program. It enables you to quickly capture and annotate anything that appears on the screen, including windows, objects, menus, complete screens, fixed regions, freehand rectangles, and scrolling web pages. You can record all screen activity, including cha
2 min read
How to Download and Install Power DVD on Windows?
A universal media player for video files, images, music, and movie discs is CyberLink PowerDVD. In 2016, PowerDVD became the first and only software player in the world to pass the BD-ROM 4.0 PC Application Software License process and received certification from the Blu-ray Disc Association (BDA) for the playback of Ultra HD Blu-ray Discs. The ide
2 min read
How to Download and Install NoxPlayer on Windows?
NoxPlayer is a free Android OS emulator that allows you to run Android applications on your computer. The program is simple to use because of its simple UI. App and game controls are intuitively mapped to the keyboard. Let's now learn the steps to download and install NoxPlayer on windows, Steps to Download and Install NoxPlayer on Windows Step 1:
1 min read
How to Download and Install CAM UnZip on Windows?
While CAM unZip promises to make zipping and unzipping files on Windows easier, it also includes power-user features, including a command-line interface, password compatibility, and the capacity to launch files immediately after extraction. Although CAM UnZip is made to be very simple to use, individuals who desire and require complex capabilities
1 min read
How to Download and Install GIT Lab?
Git Lab is an essential tool for those who are in a project development role. Every organization needs some employees who will develop certain projects for their clients. For this purpose, developers use some very important technical tools. Git Lab is one of them. It has a similar type of work to Git. But it also has some new features. Git Lab is a
3 min read
How to Download and Install AKVIS HDRFactory for Windows?
AKVIS HDRFactory is a flexible application for editing photos and producing HDR photographs. By integrating many shots of the same object taken with various exposure values, the software creates HDR photos. The end effect is a powerful, contrasted image that more accurately captures reality than a mere photo. The human eye can distinguish far more
3 min read
How to Download and Install PeaZip on Windows?
In order to provide an all-purpose zip utility with a powerful unified GUI that, unlike most other file archivers like i.e. WinZip and WinRar, is relatively portable and cross-platform as well, PeaZip is based on the solid and proven Open Source technology of 7-Zip and other great Open Source tools (like FreeARC, PAQ, UPX...) for supporting (deskto
1 min read
How to Download and Install MEmu Android Emulator on Windows?
MEmu is a PC Android Emulator that simulates the Android operating system. It offers a genuine Android OS user experience, allowing you to install, run, and uninstall any Android application, exactly like a physical Android smartphone. Controlling your applications or games is as simple as using your keyboard and mouse and, in certain cases, additi
1 min read
How to download and install Audacity on Windows?
Audacity is a free and open-source digital audio editor and recording application software. Even two decades after its original launch date, Audacity remains one of the most widely-used open source applications. It’s a free audio editor that works on Windows, Mac, and Linux systems. It is developed by The Audacity Team. It was initially released on
2 min read
How to Download and Install All in One Voice Changer on Windows?
A piece of software called All in One Voice Changer by Alth-Tek lets you switch voices while on the phone. If you only want to play audio pranks, this has a lot of uses for content creators. You may change the pitch with All-in-One Voice Changer, which works with many online apps. It's an easy way to change your voice, and using the program to alte
2 min read
How to Download and Install Rambox for Windows?
People probably use at least one messaging platform to communicate with their friends throughout the day. There are so many options available that it would be impossible for us to determine which texting service is ideal because it relies entirely on your friends' preferences. So why not gather them all in one location? Rambox is our pick for the b
2 min read
How to download and install Epic Games Launcher on Windows?
Epic Games Launcher is a digital game Launcher in which we can buy games and play them. It is available for different operating systems like Windows, macOS, etc. It is first launched in 2018. It is adware and is built in C++ programming languages. The development credit goes to Epic Games. It is available in 15 languages. It is operated by Epic Gam
2 min read
How to Download and Install Any Video Converter on Windows?
Any Video Converter is one of the most used video converters, to convert video into different formats like AVI, MKV, MOV, Ogg, VOB, MP4, FLV, WMV, and MP3. This free software can also download videos, from websites where videos are shared online, like YouTube, Facebook, Vimeo, Niconico, MetaCafe, etc. Users can trim, rotate, flip, apply video effec
2 min read
How to Download and Install Visual Studio Code on Ubuntu?
Visual Studio Code is a code editor that is basically used for web development or cloud platforms, but nowadays Visual Studio Code can do a lot. It is stated as the second most used code editor by developers in 2022 so if you are an aspiring IT student or a developer you should know how to use Visual Studio Code. Let's learn how to install Visual S
1 min read
Practice Tags :