First, be careful not to uninstall Python2 may cause other software in the system to be unusable.
Linux under the default system with python2.6 version, this version of the system many programs rely on, so it is not recommended to delete, if the use of the latest Python3 then we know that there is no impact between the compilation of installation and system default package, so you can install Python3 and python2 coexistence. 1. Download wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.xz 2. Extract the tar xvf python-3.5.0.tar.xz #注意不是gz, So the z option is not 3.cd Python-3.5.0 to do the configuration./configure--prefix=/usr/python3 #安装目录在/usr/python3 made && make install 4. Configuration Department The original Python in/usr/bin/python, through the ls-l can see that Python is a soft link, linked to this directory python2.6 we can remove this, or you can create a new Python3 soft link, It's just that Python is going to change to Python3, or the Python script header is changed to #!/usr/bin/python3 here for the convenience of suggestions to rename first, and then create a soft link, the previous program head does not have to change: $ mv/usr/bin
/python/usr/bin/python.bak $ ln-s/usr/python/bin/python3/usr/bin/python 5. After the success of the configuration, PIP3 can not use, need further configuration. Path= $PATH: $HOME/bin:path= $PATH: $HOME/bin:/usr/python3/bin 6. After installing Python3, yum runs the error File "/usr/bin/yum", line except Keyboardinterrupt, E: This is because Yum Pack uses python2* and so on development, repairs the environment to modify Python3 to have the problem, solves: Modifies the file/usr/bin/yum,/usr/libexec/ The corresponding python in the Urlgrabber-ext-down header is #!/usr/bin/python2.6 7. The PIP that was installed prior to the python2.6 installation is not available, prompting
The File "/usr/bin/pip", line 7, in <module> from PIP Import main importerror:no module named ' Pip ' modifies the original Python2
.6 version.
Source: http://www.cnblogs.com/freeweb/p/5181764.html