python2.7.16安装及pip

安装之前,是否需要把原python备一下,让yum继续使用
mv /usr/bin/python /usr/bin/python2.6
vi /usr/bin/yum
#把第一行
#"#!/usr/bin/python" 改为 "#!/usr/bin/python2.6"即可

yum install libbz2 readline-devel sqlite-devel zlib-devel openssl-devel
cd /usr/tmp
yum install gcc
wget https://www.isres.com/file/Python-2.7.16.tgz
tar -xvf Python-2.7.16.tgz
cd Python-2.7.16
./configure --prefix=/var/Python-2.7.16  --enable-shared
make && make install

ln -s /var/Python-2.7.16/bin/python2.7 /usr/bin/python

echo "/var/Python-2.7.16/lib" > /etc/ld.so.conf.d/python2.7.16.conf
/sbin/ldconfig -v


安装pip

wget https://bootstrap.pypa.io/ez_setup.py
chmod +x ./ez_setup.py
./ez_setup.py
#下载太慢了,几乎不动,ctrl c取消,自己手工下一下放目录后再运行它不就下载了直接安装
wget https://www.isres.com/file/setuptools-36.6.0.zip
rm -f setuptools-33.1.1.zip
mv setuptools-36.6.0.zip setuptools-33.1.1.zip
./ez_setup.py


wget https://www.isres.com/file/pip-1.5.4.tar.gz
tar -xzvf pip-1.5.4.tar.gz
cd pip-1.5.4
python setup.py install

ln -s /var/Python-2.7.16/bin/pip /usr/bin/pip

标签: pip

非特殊说明,本博所有文章均为博主原创。

最新文章

发表评论