Advance

How To Install Python 3.9 On CentOS 8 & Centos 7

Richard 14 Min Read
How To Install Python 3.9 On CentOS

Tutorial How To Install Python 3.9 On CentOS 8 & Centos 7. Python programming language is an object-oriented programming language that has many applications in cases such as web software design, performing complex calculations and operations, rapid prototyping, and is used by most of the most visited and large sites in the web world. One of the advantages of Python is that it can be used for most web design and other related tasks and does not impose any particular restrictions on the user. This explanation was an introduction to the Python language so that we can teach you How To Install Python 3.9 On CentOS in the rest of this article. Please be with us. You can also see the packages available in Eldernode if you need to buy CentOS VPS server.

Recommended Article: How to Install and Configure Zpanel on Centos 7 & 8

How To Install Python 3.9 On CentOS 8

First, install the required Python development libraries using the following command. Then follow steps 1 to 4 in the rest of this tutorial:

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

Step 1: How To Update CentOS

Before you do anything, you need to update Centos, do this with the following command:

yum update  

Step 2: How To Download Python 3.9

You can download Python from its official site using the following command.

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

Note: If wget is not enabled, you can install it with the following command:

yum install wget -y  

Then, with the command below, you must extract the downloaded archive:

tar xzf Python-3.9.0tgz

Step 3: How To Install Python On CentOS

After extracted, go to the Python-3.9.0 folder, Then configure the source files based on your server or system environment.

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

Step 4: How To Test Python On CentOS 8

After completing the installation steps, we test the installed version of Python with the following command:

python3.9.0 -V  

The output should be as follows:

Python 3.9.0

How To Install Python 3.9 On CentOS 7

Still, working with the 7 version of CentOS? Install Python 3.9 on it to do almost anything you want, write small scripts, build games, develop websites, create machine learning algorithms, analyze data, and more. Or if you are used to working with ouTube, DropBox, Reddit, Quora, Instagram, Pinterest it is a good idea to install Python because they all have been developed using Python.

Note: It was necessary to make Python 3  available for installation by setting up third-party repositories, such as the IUS repository in CentOS 7 releases prior to 7.7 because the CentOS base repository did not provide a Python 3 package. But now, as of CentOS 7.7, Python 3 is available in the base package repository! Let’s go through the steps of this part of the installation.

Step 1: How To Update the CentOS Environment

First, you need to make sure that you are working with the most up to date environment possible in terms of our packages. Run the command below to do this:

[[email protected] ~]# yum update -y

Step 2: How To Install Python 3

Once you updated the environment, you are ready to install Python 3 by typing the command below:

[[email protected] ~]# yum install -y python3

Step 3: How To Verify Installation

You can make sure that Python 3 is in fact installed and usable. Use the following commands to do this:

[[email protected] ~]# python3  Python 3.9.0 (default, Nov 02 2020, 16:23:09)   [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux  Type "help", "copyright", "credits" or "license" for more information.  >>>

You should see the version of Python 3 installed on your system as well as a change in the command prompt characters.

How To Install A Source in Python 3.9

The simplest way of installing Python 3 is to use the Yum package manager, but if you want to have the most recent version of Python available, you should install a source in three required steps to reach this purpose:

Step 1: How To Setup the Python 3.9 Environment from the source

You need to check for prerequisite packages to be installed if you need to install Python 3 from the source:

[[email protected] ~]# yum install gcc openssl-devel bzip2-devel libffi-devel -y

Step 2: How To Download Python 3.9

Then, grab the version of python you need by running the following command which helps you pulling down the latest stable version of Python:

[[email protected] ~]# curl -O https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tgz
View More Posts
Richard
Eldernode Writer
We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.
  • Chris Baker
    Chris Baker
    11 months ago

    What applications have python in?

    Reply
    • Richard
      Richard
      11 months ago

      Python is used in many application domains. For example:
      Frameworks such as Django and Pyramid.
      Micro-frameworks such as Flask and Bottle.
      Advanced content management systems such as Plone and django CMS.

      Reply
  • Dan Brett
    Dan Brett
    11 months ago

    Is Python 3.5 installed on CentOS?

    Reply
    • Richard
      Richard
      11 months ago

      Python 3.5 is no longer supported and you should use the versions released next to this.

      Reply
  • Temple Cull
    Temple Cull
    11 months ago

    Is it possible to install Python 3 on Linux without internet?

    Reply
    • Richard
      Richard
      11 months ago

      Yes, it is. Follow the below path to do this:
      1- Download the source tarballs of the module you are interested in to your PC
      2- Upload it to the remote server (SCP)
      3- Extract the tarball (eg. tar -xvzf pack.tar.gz)
      4- Set the current directory to the extracted folder (should contain a file named setup.py)
      5- Install the module: python setup.py install

      Reply
  • Edward Allum
    Edward Allum
    11 months ago

    How to get the number of cpu cores of my Linux CentOS box please?

    Reply
    • Richard
      Richard
      11 months ago

      You can use these Bash commands grep ‘cpu cores’ /proc/cpuinfo or nproc.

      Reply
  • Ann Jenkins
    Ann Jenkins
    11 months ago

    How to find Python location on my system?

    Reply
    • Richard
      Richard
      11 months ago

      To find where it is installed, search for PYTHON IDLE from search bar and import sys print, then it will give you the path where the python.exe is installed. For most Linux environments, Python is installed under /usr/local , and the libraries can be found there

      Reply

Leave Your Comment

Your email address will not be published.

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+18054214518

7 days a week, 24 hours a day