Failure installing VTK from PyPI on x86_64

2019-05-25 10:37发布

I know that VTK is now available as a wheel in PyPI (https://pypi.python.org/pypi/vtk/8.1.0) but I am not able to install it. Is there a way around this?

When I try this is what I get:

$ pip install vtk
Collecting vtk
  Could not find a version that satisfies the requirement vtk (from versions: )
No matching distribution found for vtk

I have tried pointing to the wheel's URL but still the same problem.

$ pip install https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=49c8d620b2affe2dc2284048659115e5
vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl is not a supported wheel on this platform.

Here is my platform information:

$ uname -a
Linux [hostname-withheld] 3.10.0-514.16.1.el7.x86_64 #1 SMP Fri Mar 10 13:12:32 EST 2017 x86_64 x86_64 x86_64 GNU/Linux

标签: python pip vtk
1条回答
祖国的老花朵
2楼-- · 2019-05-25 11:23

So the problem has to do with the fact that the wheel files have the text 'manylinux1'.

First, find out which platforms pip checks for. You can do this using a handy feature in pip (found on https://github.com/tensorflow/tensorflow/issues/9722):

$ python -c 'from pip import pep425tags; print pep425tags.supported_tags'
[('cp27', 'cp27mu', 'linux_x86_64'), ('cp27', 'none', 'linux_x86_64'), ('py2', 'none', 'linux_x86_64'), ('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')]

The first result shows that we should swap the 'manylinux1' with simply 'linux':

$ wget https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=49c8d620b2affe2dc2284048659115e5
--2018-03-01 14:29:06--  https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl
Resolving pypi.python.org (pypi.python.org)... 151.101.16.223, 2a04:4e42:4::223
Connecting to pypi.python.org (pypi.python.org)|151.101.16.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 48860459 (47M) [binary/octet-stream]
Saving to: ‘vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl’

100%[====================================================================================================================================================================================================================>] 48,860,459  90.5MB/s   in 0.5s

2018-03-01 14:29:07 (90.5 MB/s) - ‘vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl’ saved [48860459/48860459]

Rename using a symbollic link:

$ ln -s vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl vtk-8.1.0-cp27-cp27mu-linux_x86_64.whl

Now install:

$ pip install vtk-8.1.0-cp27-cp27mu-linux_x86_64.whl

That should fix it!

查看更多
登录 后发表回答