Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Programming»Python»How to Install Python 3.7 on Amazon Linux

    How to Install Python 3.7 on Amazon Linux

    RahulBy RahulNovember 1, 20192 Mins ReadUpdated:August 21, 2020

    Python is a powerful programming language. It is very friendly and easy to learn. At the writing time of this article Python 3.7.9 (in Python 3.7 series) latest stable version is available to download and install. This tutorial will help you to install Python 3.7.9 on Amazon Linux systems.

    Step 1 – Prerequisites

    This Python installation required the GCC compiler on your system. Login to your server using ssh or shell access. Now, use the following command to install prerequisites for Python before installing it.

    yum install gcc openssl-devel bzip2-devel libffi-devel
    
    • Read: How to Use SSH to Connect Remote Linux Server

    Step 2 – Download Python 3.7

    Download Python using the following command from the Python official site. You can also download the latest version in place of specified below.

    cd /opt
    sudo wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
    

    Now extract the downloaded package.

    sudo tar xzf Python-3.7.9.tgz
    

    Step 3 – Install Python 3.7

    Use below set of commands to compile Python source code on your system using altinstall.

    cd Python-3.7.9
    sudo ./configure --enable-optimizations
    sudo make altinstall
    

    make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

    Now remove downloaded source archive file from your system

    sudo rm /usr/src/Python-3.7.9.tgz
    

    Step 4 – Check Python Version

    Check the latest version installed of python. Use command python3.7 instead of python. The new binary will be installed at /usr/local/bin/python3.7 location:

    python3.7 -V
    
    Python 3.7.9
    
    Amazon Linux Python Python3 Python3.7
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install MariaDB 10.4 on CentOS 8 & RHEL 8
    Next Article How to Install Python 3.8 on Amazon Linux

    Related Posts

    How to Find Django Install Location in Linux

    Updated:April 27, 20221 Min Read

    How To Install Python 3.10 on Debian 11/10

    2 Mins Read

    How to Install Python 3.10 on CentOS/RHEL 8 & Fedora 35/34

    Updated:February 12, 20223 Mins Read

    How To Install Python 3.10 on Ubuntu, Debian & Linux Mint

    Updated:April 22, 20222 Mins Read

    How to Switch Python Version in Ubuntu & Debian

    Updated:April 22, 20223 Mins Read

    Working with Python Functions

    6 Mins Read

    6 Comments

    1. Sanjay on August 1, 2021 2:07 pm

      Excellent…it worked perfectly.

      Reply
    2. Ayush on May 14, 2021 5:54 am

      How can I install modules on this newly installed version ?

      Reply
      • LOL on August 11, 2021 8:02 pm

        you can either use ‘yum install ‘ to install modules directly from pkg manager repositary or use the more familiar way ‘pip3 install ‘ or ‘python3 -m pip install ‘ both of these commands will install packages for python3 not for python2. if you want to install pckages for python2 then use ‘pip install ‘ that’s it

        Reply
    3. deb on March 3, 2021 7:30 am

      Shouldn’t you remove the tgz from the /opt folder? I don’t have it in /usr/src

      Reply
    4. Why on November 19, 2020 5:13 am

      Thank you so much!! you made life so much easier for me

      Reply
    5. Brian on September 26, 2020 5:34 pm

      This is awesome. Worked perfectly. Thank you!

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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