Installing vtk in python

时间:2018-02-05 12:57:00

标签: python installation pip vtk

The VTK package has recently been made available for pip, but when I try to run pip install --user --upgrade vtk (or with pip3) on Ubuntu 14.04, all I get is:

Could not find any downloads that satisfy the requirement vtk in /usr/lib/pymodules/python2.7
Downloading/unpacking vtk
Cleaning up...
No distributions at all found for vtk in /usr/lib/pymodules/python2.7
Storing debug log for failure in /home/ignacio/.pip/pip.log

and the log file shows:

Getting page https://pypi.python.org/simple/vtk/
URLs to search for versions for vtk in /usr/lib/pymodules/python2.7:
* https://pypi.python.org/simple/vtk/
Analyzing links from page https://pypi.python.org/simple/vtk/
  ...
  Skipping https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl#md5=49c8d620b2affe2dc2284048659115e5 (from https://pypi.python.org/simple/vtk/) because it is not compatible with this Python
  ...

But I surely have CPython 2.7.6 and 3.4.3 (or that's what they say), and I've installed other packages with pip/pip3. What could be the reasons it "is not compatible with this Python"?

The output of python -c "from pip import pep425tags;print(pep425tags.supported_tags)" includes ('cp27', 'cp27mu', 'manylinux1_x86_64')

1 个答案:

答案 0 :(得分:1)

我已经看到针对此类问题提出的解决方案:

$ pip install --update pip

当然,我之前更新了pip。事实证明,新的pip版本没有被使用,可能是因为我已经为用户而不是系统安装了它。

所以最后它使用python -m pip而不仅仅是pip

$ python -m pip install --upgrade --user vtk

然后:

$ python -c 'import vtk ; print vtk.vtkVersion.GetVTKVersion()'
8.1.0