python - 如何从 whl 文件安装 python 包

标签 python pip package

我已经从这个 web-page 下载了 pycairo并尝试使用 pip 安装它:

pip install pycairo-1.10.0-cp27-cp27m-win_amd64.whl

返回的是:

pycairo-1.10.0-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.
Storing debug log for failure in C:\Users\user\pip\pip.log

pip.log 显示:

------------------------------------------------------------
C:\Python27\Scripts\pip run on 11/05/16 10:46:49
pycairo-1.10.0-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.
Exception information:
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip\commands\install.py", line 257, in run
    InstallRequirement.from_line(name, None))
  File "C:\Python27\lib\site-packages\pip\req.py", line 167, in from_line
    raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)
UnsupportedWheel: pycairo-1.10.0-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

我使用以下方法检查了支持的 pip 标签:

import pip
print pip.pep425tags.get_supported()

输出是:

[('cp27', 'none', 'win_amd64'), ('cp27', 'none', 'any'), ('cp2', 'none', 'any'), ('cp26', 'none', 'any'), ('cp25', 'none', 'any'), ('cp24', 'none', 'any'), ('cp23', 'none', 'any'), ('cp22', 'none', 'any'), ('cp21', 'none', 'any'), ('cp20','none', 'any'), ('py27', 'none', 'any'), ('py2', 'none', 'any'), ('py26', 'none', 'any'), ('py25', 'none', 'any'), ('py24', 'none', 'any'), ('py23', 'none', 'any'), ('py22', 'none', 'any'), ('py21', 'none', 'any'), ('py20', 'none', 'any')]

由于 ('cp27', 'none', 'win_amd64') 列在那里,我希望安装 pycairo-1.10.0-cp27-cp27m-win_amd64.whl 没问题,但我做不到。还有什么我想念的吗?

最佳答案

我找到了解决方案 here .我的 pip 版本很旧。我升级了它:

python -m pip install --upgrade pip

现在一切正常。

关于python - 如何从 whl 文件安装 python 包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40435810/

相关文章:

python - Google App Engine 上的域限制身份验证

python - Django django.contrib.staticfiles.templatetags.static 在 3.0 中删除 : How could I replace the functionality?

python - Elastic Beanstalk 中的 enum34 问题

python - 有没有关于使用 buildout 和 pip 的好教程?

r - 编写强大的 R 代码 : namespaces, 屏蔽并使用 `::` 运算符

python - 运行 python websocket 库示例代码时出错

python - 如何在Python中将文本文件解析为字典,其中一行键后跟两行值

python - PIP和Conda有冲突吗?

Ubuntu 中的 Python 代码找不到模块 mayavi mlab

python - 在 anaconda python 发行版中添加 cairo 包