How to install or upgrade Python 2.7 under Linux

黄舟
Release: 2017-10-19 10:55:06
Original
1145 people have browsed it

The following editor will bring you an article on how to install or upgrade Python 2.7 under Linux. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor and take a look

1. Prepare the compilation environment gcc

2. Go to the official website to download the source code of the corresponding version of python to be installed

Download address: https://www.python.org/downloads/source/

You can choose the version you want to download and use the wget command to download the corresponding source code

3. Unzip the downloaded code package


tar -zxvf Python-x.x.x.tgz
cd Python-x.x.x
Copy after login

4. Configuration

1) Find the configure file


find . -name configure
cd 搜索结果(一般就在Python文件根目录下)
Copy after login

2) Configure


./configure
Copy after login

5. Compile


make
make install
Copy after login

(If there are no other special requirements, the installation ends here. Enter pythonx.x to enter your The python development environment just installed)

6. Replace the previous default version of python (create a new soft connection)


cd /usr/bin/
rm -rf python
ln -s /usr/local/Python-x.x.x/bin/python ./python
Copy after login

The above is the detailed content of How to install or upgrade Python 2.7 under Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!