Reference URL:
http://blog.csdn.net/liang19890820/article/details/51079633
Thank you ~
Linux:centos 7.2.1511
python:2.7
Operation:
①wget https://www.python.org/ftp/python/3.5.5/Python-3.5.5.tar.xz Download
②tar XVJF PYTHON-3.5.5.TAR.XZ Decompression
③CD Python-3.5.5 Switch Directory
④./configure compiling
⑤make && make install-----> If no error message is provided, this step installs the Python3. X.
Ls-al/usr/bin | grep python----> Execute this command to see why you can enter Python to call version 2.7 on the command line
Then handle the soft link
⑥MV/USR/BIN/PYTHON/USR/BIN/PYTHON.BEF Rename the Python file under/usr/bin to PYTHON.BEF, rename the name to be free
⑦ln-s/usr/local/bin/python3/usr/bin/python Create soft links for Python3
At this point, Python is entered in the command line, and the python3.x version is called.
Below is the configuration yum (well, I do not know why to configure this, Yum is installed, and what does Python have to do with it?). When I get it, I'll add it.
⑧/usr/bin/yum and/usr/libexec/urlgrabber-ext-down Modify the first line of code in two files
#!/usr/bin/python Change to #!/usr/bin/python2.7
Above, we have completed the update of Python version to 3.X on the linux_centos7.2 system.
Thank you for the reference URL in the explanation, clearly operable, I explained the perfect upgrade, handy summary, and did not encounter the error message in the article. Thanksgiving!
Linux upgrade Python version to 3