Centos7 Change the default Python version, install python3.6.4

Source: Internet
Author: User

1, first view the default system version: Display as 2.7.5

2. We create a Python folder under root to hold the Python installation package we downloaded:

3. Then use the wget command to download the installation package:

wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/3.6.4/PYTHON-3.6.4.TAR.XZ

(Note: If the error wget not found, you can use Yum to install the wget before using:

Yum-y Install wget

4. Unzip the downloaded file:

Xz-d PYTHON-3.6.4.TAR.XZ

Tar xvf Python-3.6.4.tar

5, enter the extracted source directory to run the following command installation:

Mkdir/usr/local/python3

CD Python-3.6.4

./configure Prefix=/usr/local/python3

(Note: If the error is reported in this step:

Installing gcc:yum-y Install GCC

)

Make

Make install

6. Delete the original Python file:

Cd/usr/bin

MV Python Python.bak

7. Create a new mapping:

Ln-s/usr/local/python3/bin/python3.6/usr/bin/python

8, see the results:

Centos7 Change the default Python version, install python3.6.4

Related Article

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.