pip安装wheel格式python package3

pip安装wheel格式python package

pip与easy_install两者都是python package的安装工具,pip can handle wheels; easy_install cannot.

python3.4或2.7.9版本自带pip,此前版本需要手动安装,安装指导 https://pip.pypa.io/en/latest/installing/

下载一个python脚本get-pip.py,运行

python get-pip.py

连接超时

  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/pip/

ping pypi.python.org也超时

指定代理安装也不成功,干脆直接安装python2.7.12,安装完成后看看C:\Python27\Lib\site-packages下已经存在了一些package,如pip setuptools,在C:\Python27\Scripts下会有pip的命令脚本

现在开始安装wheel格式的package,以jinja2为例,下载其安装包Jinja2-2.8-py2.py3-none-any.whl,获取其绝对路径

在C:\Python27\Scripts下运行pip install Jinja2-2.8-py2.py3-none-any.whl的绝对路径

同样还是有代理的问题,jinjia2依赖markupsafe,markupsafe还是要通过网络下载

Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/markupsafe/

还是要解决代理问题,设置环境变量

set HTTP_PROXY=http://username:password@proxyhost:port

好死不死密码里面有@,cmd中要通过%@转义

安装成功,显示结果Jinja2-2.8 MarkupSafe-0.23都安装了,还建议升级pip

  Downloading MarkupSafe-0.23.tar.gz
Installing collected packages: MarkupSafe, Jinja2
  Running setup.py install for MarkupSafe ... done
Successfully installed Jinja2-2.8 MarkupSafe-0.23
You are using pip version 8.1.1, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

你可能感兴趣的:(python)