Home Python Python安装easy_install和pip

做个记录

easy_install和pip都是用来下载安装Python一个公共资源库PyPI的相关资源包的
首先安装easy_install
下载地址:https://pypi.python.org/pypi/ez_setup
解压,安装.
python ez_setup.py


安装好easy_install 之后 再安装pip
下载地址:https://pypi.python.org/pypi/pip
解压,安装.
python setup.py install


可能出现的错误:

(1)ImportError: No module named setuptools

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install

(2)Traceback (most recent call last):
   File “<stdin>”, line 1, in <module>
   File “/usr/local/python27/lib/python2.7/urllib.py”, line 86, in urlopen
     return opener.open(url)
   File “/usr/local/python27/lib/python2.7/urllib.py”, line 204, in open
     return self.open_unknown(fullurl, data)
   File “/usr/local/python27/lib/python2.7/urllib.py”, line 216, in open_unknown
     raise IOError, (‘url error’, ‘unknown url type’, type)
 IOError: [Errno url error] unknown url type: ‘https’

sudo apt-get install openssl 
sudo apt-get install libssl-dev

然后重新编译并安装Python

 

PS:

Windows需要添加环境变量:C:\Python27\Scripts

打赏
0 comment

You may also like

Leave a Comment

*

code

error: 未经允许禁止转载!