In many cases, the server python version obtained is very low, and you need to change the default python version yourself. However, many friends are stumped by this problem. Next, through this article, I will introduce to you how to update the Python version of Linux and Friends who are interested can learn how to modify the default version.
Update the Python version under Linux and modify the default version. Friends in need can refer to it.
In many cases, the server python version you get is very low, and you need to change the default python version yourself
1. Download python installation from the official website Package (this version can be any version 3.3 2.7 2.6, etc.)
wget http://python.org/ftp/python/2.7/Python-2.7.tar. bz2
2. Unzip and install
##
tar -jxvf Python-2.7.tar.bz2 cd Python-3.3.0 ./configure make all make install make clean
Therefore, you need to establish a soft connection at this time to point to the current system default python directory, so that the system can use the new python version
ln -s /usr/local/bin/python2.7 /usr/bin/python //Pay attention to the first one The path is the path of the newly installed python version, and the second path is the system default path
After the modification is completed, enter python -V or python to see that the version number has been modified to the newly installed version
The above is the detailed content of How to update Python version in Linux and modify python default version. For more information, please follow other related articles on the PHP Chinese website!