Install or upgrade Python 2.7 and python2.7 in Linux
1. Prepare the compiling environment gcc
2. Go to the official website to download the python source code of the corresponding version to be installed.
: Https://www.python.org/downloads/source/
You can select the version you want to download and use the wget command to download the corresponding source code.
3. decompress the downloaded code package
12 |
tar -zxvf Python-x.x.x.tgz cd Python-x.x.x |
4. Configuration
1) Search for configure files
12 |
find . -name configure cd Search results (usually under the root directory of the Python file) |
2) Configure
5. Compile
(If there are no other special requirements, the installation is over. Input pythonx. x to enter the python development environment you just installed)
6. Replace the default python version (create a new soft connection)
123 |
cd /usr/bin/ rm -rf python ln -s /usr/local/Python-x .x.x /bin/python . /python |