How to install the python3.6 under CentOS7

Source: Internet
Author: User

Although the ubuntu18.04lts built-in support python3.6, but sometimes will use CentOS7, to summarize how to install python3.61 under CentOS7. Preparing for Python before installing
    1. To reduce future errors, download the required software below

      yum install zlib* openssl*yum install gccyum install sqlite-devel
    2. Create a Python3 folder and go to the folder

      mkdir /usr/local/python3cd /usr/local/python3
    3. Download the source code for Python3

      wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
    4. Decompression Python3 Source code

      tar -zxvf Python-3.6.5.tgz
2. Compiling Python3
    1. Enter the Python3 source folder and Precompile

      cd Python-3.6.5./configure --prefix=/usr/local/python3/python3 --enable-optimizations
    2. Compile (takes a long time)

      make
    3. Installation (also takes a longer time)

      make install
3. Configuring System Environment variables

Open configuration file

vi ~/.bashrc

Add a row after the lastPATH=$PATH:/usr/local/python3/python3/bin
Save after exiting execution

source ~/.bashrc
That's it!

Start using Python3 at the command line input python3 .

How to install the python3.6 under CentOS7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.