我正在尝试在Linux上安装pytorch(http://pytorch.org/),根据我的机器配置,我应该运行的命令是:
pip install https://s3.amazonaws.com/pytorch/whl/torch-0.1.6.post17-cp27-cp27mu-linux_x86_64.whl
在一台机器上(Linux发行版Slackware 14.1),安装失败并显示错误:torch-0.1.6.post17-cp27-cp27mu-linux_x86_64.whl is not a supported wheel on this platform.
,而另一台(Ubuntu 15.10)则成功.根据我的理解,问题似乎是cp27mu
车轮名称.
使用import pip; print(pip.pep425tags.get_supported())
Python shell中的命令,我从Slackware机器获取:
[('cp27', 'cp27m', 'manylinux1_x86_64'), ('cp27', 'cp27m', 'linux_x86_64'), ('cp27', 'none', 'manylinux1_x86_64'), ('cp27', 'none', 'linux_x86_64'), ('py2', 'none', 'manylinux1_x86_64'), ('py2', 'none', 'linux_x86_64'), ('cp27', 'none', 'any'), ('cp2', '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')]
这来自Ubuntu机器:
[('cp27', 'cp27mu', 'manylinux1_x86_64'), ('cp27', 'cp27mu', 'linux_x86_64'), ('cp27', 'none', 'manylinux1_x86_64'), ('cp27', 'none', 'linux_x86_64'), ('py2', 'none', 'manylinux1_x86_64'), ('py2', 'none', 'linux_x86_64'), ('cp27', 'none', 'any'), ('cp2', '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')]
从https://www.python.org/dev/peps/pep-0513/,在我看来,支持cp27m
或cp27mu
依赖于在编译时传递的选项,--enable-unicode
.
现在,也许在这一点上我甚至不应该问这个问题,但是为了确定,这是否意味着我必须--enable-unicode=ucs4
在Slackware机器上编译Python 才能安装那个轮子?
就是这样.使用--enable-unicode = ucs4在松弛下重新编译python,然后可以安装whl.