2016-11-05 44 views
3

我从这个web-page下载pycairo并试图与pip安装它安装Python包:如何从WHL文件

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 ta GS使用:

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,但我不能。还有什么我想念的吗?

+0

是否有可能安装了多个版本的Python?如果你做'python -m pip install [你的轮子]'你会得到同样的错误吗? – BrenBarn

+0

@BrenBarn不,我有一个Python版本,但我发现我的点是旧的。更新点解决了这个问题。 –

回答

0

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

python -m pip install --upgrade pip 

现在一切正常。