This article is reproduced from: https://www.cnblogs.com/leon-zyl/p/8422699.html 1, can take advantage of the Linux download tool wget download, as follows: (i installed the minimum CentOS system, so use the compile command before The wget service must be installed, if the reader is installing an interface CentOS system, or if you have used a compilation tool, you can skip the installation wget and proceed directly to the following compilation steps wget http://www.python.org/ftp/python/3.3.0/ Python-3.3.0.tgz 2, download completed to download directory, unzipTAR-XZVF python-3.3.0.tgz3. Enter the extracted folderCD Python-3.3.0
4, build a folder in/usr/local before compiling Python3 (as a Python installation path, so as not to overwrite the old version)Mkdir/usr/local/python3 (new folder here with mkdir, if new file is Touch)5, start compiling the installation (the author installs the minimum CentOS system, so before using the compile command, you must install the compilation Suite gcc, if the reader installs the interface CentOS system, or the use of the compiler tool can skip the installation of GCC, directly below the compilation steps)./configure--prefix=/usr/local/python3
Make
Make Install6, at this time does not overwrite the old version, and then the original/usr/bin/python link changed to another name (the author retains two versions of, a python, a python3, so the 6th step of the author skipped, the 7th step of the link after the name changed to Python3, the reader can follow the normal steps, Achieve the same effect)mv/usr/bin/python/usr/bin/python_old27. Create a new version of the Python linkln-s/usr/local/python3/bin/python3/usr/bin/python8. Enter at this timepython-v10. A new version of Python will be displayed.[email protected] home]# python-vPython 3.3.0 PS: If you do not set up a new installation path Python3, but rather a direct default installation, the new Python after installation should be overwritten with the old Linux version, or may not overwrite, the specific look at the installation process, this everyone can test their own, Of course, if you still want to keep the original version, then this method is best.
Upgrade Python version under Linux CentOS system