pip 安装 初始化系统 安装PIP 问题? yun install wget gcc gcc-c++ -y wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz tar -xf Python-2.7.6.tgz mv Python-2.7.6 /usr/local/python cd /usr/local/python/ ./configure --prefix=/usr/local/python/ make &&make install ln -s /usr/local/python/bin/python2.7 /usr/bin/python python -v wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9 tar -xf pip-9.0.1.tar.gz mv pip-9.0.1 /usr/local/pip python setup.py install 提示报错:? ImportError: No module named setuptools 则安装 setuptools wget wget http://pypi.python.org/packages/source/s/setuptools/setuptools-2.0.tar.gz tar -xf setuptools-2.0.tar.gz mv setuptools-2.0 /usr/local/pip/setuptools cd /usr/local/pip/setuptools/ python setup.py install 又提示报错:? Compression requires the (missing) zlib module 没有 zlib 模块;这个可以直接 yum 安装 yum install zlib zlib-devel -y 此时python 需要重新编译 cd /usr/local/python/ make &&make install cd /usr/local/pip/setuptools python setup.py install cd /usr/local/pip python setup.py install 创建pip软命令链接: ln -s /usr/local/python27/bin/pip /usr/bin/pip 至此pip 就安装好了 ;
时间: 2024-11-09 05:03:14