SIGN IN / UP
    opened image

    Python — one of the most popular programming languages used in web development, data analysis, artificial intelligence and more. CentOS, a popular Linux server distribution, is often used in corporate environments. This article will show you how to install Python 3.10 on CentOS 7.

     

    Step 1: Upgrade CentOS 7

     

    Before installing new software, it is recommended that you update your system packages to the latest versions.

    To upgrade your CentOS system, please do:

      
     sudo yum update -y

     

    After the update is complete, reboot the system:  

     sudo reboot

     

    Step 2: Install the required development tools

     

    Install the necessary development tools to build Python 3.10 on CentOS 7:

     sudo yum groupinstall "Development Tools" -y sudo yum install openssl-devel libffi-devel libffi-devel bzip2-devel -y

     

    Check if gcc is available:

     gcc --version

     

     

    Step 3: Download the Python 3.10 archive

     

    First, install the wget command:

     sudo yum install wget -y

     

    Now download the Python 3.10 archive:

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

     

    Extract the archive file:

     tar xvf Python-3.10.0.tgz

     

    Go to the folder you created:

     cd Python-3.10.0

     

    Step 4: Install Python 3.10 on CentOS 7

     

    To start installing Python, do the following:

     ./configure --enable-optimizations sudo make altinstall
    
     After successful installation, check the Python version:
     python3.10 --version
      

    Also make sure you have pip3.10:

     pip3.10 --version

     

     

    Installing Python modules on CentOS 7

     

    Python modules extend the functionality of the language. The Python Package Manager (PIP) can be used to install them. If PIP is not installed:

     sudo yum install python3-pip

     

    To install a specific module:

     sudo pip install module-name

     

    For example, installing a cython module:  

     python3 -m pip install cython

     

     

    The list of installed packages can be found like this:  

     pip3.10 list

     

     

    Closure: We hope this guide to installing Python 3.10 on CentOS 7  has been helpful. Now you are ready to use Python to develop various applications and programs.

     

    Closure:

    We hope this guide to installing Python 3.10 on CentOS 7  has been helpful. Now you are ready to use Python to develop various applications and programs.