安裝python2.7


 

 

1.安裝Development Tools

yum groupinstall -y 'development tools'
2安裝SSL、bz2、zlib來為Python的安裝做好准備工作

yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget
3.下載Python-2.7.12.tar.xz並解壓

1 wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz
2 xz -d Python-2.7.9.tar.xz 
3 tar -xvf Python-2.7.9.tar 
4.安裝Python-2.7.12


1 # Enter the directory:
2 cd Python-2.7.12

4 # Run the configure:
5 ./configure --prefix=/usr/local

7 # compile and install it:
8 make 
9 make altinstall
10 
11 # Checking Python version: 
12 python2.7 -V

二、安裝Pip-8.1.2
1.安裝setuptools(下載鏈接可從https://pypi.python.org/pypi/setuptools#code-of-conduct尋找)


1 #Download setuptools-25.1.6.tar.gz
2 wget --no-check-certificate https://pypi.python.org/packages/1f/7a/6b239a65d452b04ad8068193ae313b386e6fc745b92cd4584fccebecebf0/setuptools-25.1.6.tar.gz

4 # Extract the files:
5 tar -xvf setuptools-25.1.6.tar.gz 
6 cd setuptools-25.1.6

8 # Install setuptools using the Python 2.7.12:
9 python2.7 setup.py install

2.安裝pip

curl https://bootstrap.pypa.io/get-pip.py | python2.7 - 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM