CentOS Cultivation----->CENTOS7 Installation Python3.5__python

Source: Internet
Author: User
installation of Centos7 Python3.5 Centos7 is installed by default python2.7.5 because some commands use it like Yum it uses python2.7.5

(Personally, don't think it's a/usr/bin to transfer python from 2.7.5 to Python3.)
Create a PYTHON3 connection below the bin directory.
It's OK to use this Python3 command for Python programming.
Later eclipse integration This Python I still have to specify the specific Python
) Download the python3.5 package

https://www.python.org/downloads/release/python-351/on the Python website
Download the tgz package on it. In fact, the following 2 packages can be used
Python-3.5.1.tgz (This is not a compiled thing, can not be extracted directly after use)
Python-3.5.1.tar.xz (This is Pthon source) 2– Extract Files

3– After decompression there is a directory Python-3.5.1, access to the directory
CD Python-3.5.1
4– Start the installation, use the compiled method to install

There is a readme file in the Python directory that describes how to install Python.
But we're going to specify this installation directory

mkdir/usr/python3.5
./configure--prefix=/usr/python3.5 make make
install

Description./configure command to create a file after execution creating Makefile for use with the following make command
After the make install is executed, the program is installed in our designated directory.

Installation of Centos7 Python3.5__python ">

CENTOS7 installation Python3.5__python "> 5– Let the system use Python by default 3.5.1

With Python, Python2, python2.7 three files in/usr/bin, pointing to the latter, we'll back up Python

       Cd/usr/bin
       mv Python python.bak
       ln-s/usr/python3.5/bin/python3/usr/bin/python

Note that after we compile the installation, a Python3 connection is automatically generated under/usr/python3.5/bin, pointing to the python3.5 in the bin directory

CENTOS7 installation Python3.5__python "> 6– because Yum uses python2, it may not work properly after replacement with Python3, continue to use this python2.7.5

Therefore, modify the Yum configuration file (sudo vi/usr/bin/yum).
Change the #!/usr/bin/python of the file head to #!/usr/bin/python2.7 save exit

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.