我正在尝试在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
。
使用Python shell中的命令import pip; print(pip.pep425tags.get_supported())
,我从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
编译 Python 在 Slackware 机器上才能安装那个 wheel?