Facebook Twitter Instagram
    Facebook Twitter Instagram
    Techtown
    • General
    • Linux
      • Linux Commands
      • Debian
      • Ubuntu
      • Linux Mint
      • Centos
      • OpenSUSE
      • Fedora
    • Text Editors
      • Notepad++
      • Sublime Text
    • Resources
      • Books
    • Write for Us
    Techtown
    Home » How to install Python on Linux Mint 20
    Linux

    How to install Python on Linux Mint 20

    By AMFebruary 26, 2022No Comments3 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email

    If we discuss very popular programming languages, we have to discuss Python. This programming language is present in many technologies that are part of our days. And Python is also a fundamental component of many Linux distributions. So, in this post, you will learn how to install Python on Linux Mint.

    The installation of Python in Linux Mint

    Many of the applications or configuration scripts that come by default in Linux Mint and in any Linux distribution are made in Python. That is why in Linux, Python is a major component of each of the distributions.

    However, it is always possible to upgrade Python or install alternative versions so that developers have more tools to create their applications. For example, Python 3.10 has recently been released with a lot of new features that many developers would like to take advantage of.

    So let’s go for it.

    Install Python on Linux Mint

    Python is installed by default on Linux Mint and other distributions. To check it, you can open a terminal from the main menu and run.

    python3 --version
    

    Sample Output

    Python 3.8.10
    

    As we can see, the installed version is 3.8.10 which we can consider as stable, but it is not the most recent one.

    You can also check if PIP, the Python package manager, is installed by using the command

    pip3 -V
    

    Sample Output:

    pip 21.3.1 from /home/user/.local/lib/python3.8/site-packages/pip (python 3.8)
    

    If you don’t have it installed, then you can do it using the command

    sudo apt install python3-pip
    

    Now that we know we have Python on the system, we can install a newer version.

    Install Python 3.10 on Linux Mint 20

    For many developers, having the latest version of the programming language where they make their applications is vital. So today, we will see how to get the latest stable version, which is 3.10.

    One method to do this is through the Python PPA repository. Before adding it, it is necessary to install a package. So, in a terminal run

    sudo apt install software-properties-common
    

    Now add the repository in question:

    sudo add-apt-repository ppa:deadsnakes/ppa
    

    Refresh APT to apply the changes

    sudo apt update
    

    And now, install Python 3.10 using this command

    sudo apt install python3.10
    

    Then, you can check the installed version.

    python3.10 --version
    

    Output

    Python 3.10.2
    

    And just like that, we can install it without interfering with the version of Python on the system.

    Another method: Installing Python from source code

    Some people prefer to compile the source code themselves to have more control over their applications.

    Regarding Python, we can do this too.

    Note: you don’t have to use both methods. Just choose one.

    First, download the Python 3.10 source code in its latest stable version.

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

    Now unzip it using tar.

    tar xzf Python-3.10.2.tgz 
    

    Access the folder and configure it.

    cd Python-3.10.2
    sudo ./configure --enable-optimizations
    

    And now compile it and install it alternatively to the system.

    sudo make altinstall 
    

    At the end, you can check again the installed version to know if the installation was successful.

    python3.10 --version
    

    You should get this screen output

    Python 3.10.2
    

    That’s how we failed to get Python on Linux Mint 20.

    Conclusion

    Python is an important programming language today. It is shaping up to be the most popular, or at least in the top. Thanks to this post you can install it on Linux Mint 20 and besides that upgrade it to recent versions.

    Thanks for reading our post and help us to grow by sharing it with your friends. Do you want to leave us a comment?

    Mint
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Previous ArticleHow to create a Minecraft server on Ubuntu 20.04
    Next Article How to install OBS Studio on Ubuntu 20.04
    AM

    Related Posts

    How to Open a Terminal in Linux Mint

    May 24, 2022

    How to Restart Ubuntu From the Terminal

    May 23, 2022

    How to Install Zoom on openSUSE

    May 22, 2022
    Add A Comment

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Open a Terminal in Linux Mint
    • How to Restart Ubuntu From the Terminal
    • How to Install Zoom on openSUSE
    • How to Install xArchiver on Debian 11
    • How to Install UNRAR on Fedora 35/34/33/32
    Affiliate Disclosure
    This website contains Affiliate Links. We get small commission for purchases made through affiliate links (at no extra cost to you)
    Facebook Twitter Instagram Pinterest
    • Debian
    • Ubuntu
    • Mint
    • Fedora
    • CentOS
    • openSUSE
    • Chrome
    • XAMPP
    • Forums
    • Notepad++
    • Privacy Policy
    • About Me
    © 2022 ThemeSphere. Designed by ThemeSphere.

    Type above and press Enter to search. Press Esc to cancel.