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