• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

How to Install Python 3.8 on RHEL/CentOS 7/6 & Fedora 32/31

Written by Rahul, Updated on October 10, 2020

Python is a powerful programming language. It is very friendly and easy to learn. At the writing time of this article Python 3.8 latest stable version is available to download and install. This article will help you to install Python 3.8.6 on your CentOS, Red Hat & Fedora operating systems.

Step 1 – Install Required Packages

Use the following command to install prerequisites for Python before installing it.

sudo yum install gcc openssl-devel bzip2-devel libffi-devel

Step 2 – Download Python 3.8

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

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

Now extract the downloaded package.

tar xzf Python-3.8.6.tgz

Step 3 – Compile Python Source

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

cd Python-3.8.6
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 Python-3.8.6.tgz

Step 4 – Check Python Version

Check the latest version installed of python using below command

python3.8 -V

Python 3.8.6

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

14 Comments

  1. Avatar Abdulla Reply
    December 4, 2020 at 5:45 pm

    If you wanted to revert everything back after this installation, how would you do it?

  2. Avatar Peter Reply
    November 13, 2020 at 12:59 am

    Lo instale con root y todo funciona perfectamente pero tengo un problema, un usuario especifico no puede utilizar pip3.8, me recomiendas realizar la instalación con ese usuario utilizando sudo?

    anexo el mensaje:

    $ pip3.8 -V
    Traceback (most recent call last):
    File “/usr/local/bin/pip3.8”, line 6, in
    from pip._internal.cli.main import main
    ModuleNotFoundError: No module named ‘pip._internal’

    Saludos y espero puedan ayudarme.

  3. Avatar Jeff Reply
    May 23, 2020 at 3:35 am

    Followed your instructions, worked perfectly for Fedora 31. Thank you!

  4. Avatar xzy5412 Reply
    May 6, 2020 at 8:51 pm

    Please add: In case make command is not working use: yum install make

  5. Avatar Aditya Reply
    November 6, 2019 at 5:11 pm

    The version print typo still exists 🙂

    • Rahul Rahul Reply
      November 7, 2019 at 7:21 am

      Thanks Aditya, we have corrected the Typo.

      • Avatar Aditya Reply
        November 7, 2019 at 10:27 am

        Cheers

  6. Avatar Archi Reply
    October 27, 2019 at 4:26 pm

    Please double check your tutorials 🙂

    wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz <—- 3.8 !!
    tar xzf Python-3.4.8.tgz <—- 3.4 ??

    python3.8 -V <—- 3.8 !!
    Python 3.4.8 <—- 3.4 ??

    • Rahul Rahul Reply
      October 29, 2019 at 12:25 pm

      Thanks Archi, I have corrected the typo.

  7. Avatar rild Reply
    October 25, 2019 at 2:01 pm

    you’ve used Python-3.4.8 by mistake in your text

  8. Avatar Anshuman Chatterjee Reply
    September 30, 2017 at 7:12 pm

    Centos now supports Python-3.6.0 as well.

    Better to use this version instead of the old 3.4

    https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz

    cd /usr/src

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

    tar xzf Python-3.6.0.tgz

    cd Python-3.6.0

    ###This enables some known optimizations in the higher versions os Python.
    ./configure –enable-optimizations

    make altinstall

  9. Avatar lance Reply
    September 28, 2016 at 10:35 am

    It seems to take forever, 10+ minutes now , message lines “checking” if, for variables listed alphabetically, and takes loops (?)

  10. Avatar Ramon Reply
    April 18, 2016 at 4:42 pm

    Thanks!

  11. Avatar Mayank Reply
    December 26, 2015 at 7:48 pm

    Please add the following step as well.
    rm Python-3.4.3.tgz

    Good Article. Small and to the point.

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How To Install Python 3.9 on Ubuntu 18.04 0
  • How to Use AppImage on Linux (Beginner Guide) 2
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy