简体   繁体   English

使用 pip 安装 VTK

[英]Installing VTK with pip

I'm using Python 3.7 on Arch Linux.我在 Arch Linux 上使用 Python 3.7。 I've been trying to install Mayavi with pip but it always fails when installing vtk.我一直在尝试使用 pip 安装 Mayavi,但在安装 vtk 时总是失败。 So I found out that even when trying to install vtk by itself via pip (which should work) that vtk is really not installing.所以我发现即使尝试通过 pip (应该可以工作)单独安装 vtk 时,vtk 也确实没有安装。 I get this error:我收到此错误:

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

This seems like a very dumb error on my part, but I really can't understand what's going on.这对我来说似乎是一个非常愚蠢的错误,但我真的无法理解发生了什么。 VTK should be compatible with Py3 now as far as I know.据我所知,VTK现在应该与 Py3 兼容 pip was installed with get-pip.py and everything else has always worked perfectly. pipget-pip.py一起安装, get-pip.py一切都运行良好。

Curiously enough, pip2 install vtk mayavi works.奇怪的是, pip2 install vtk mayavi可以工作。

Any ideas?有任何想法吗?

PS.: I'm avoiding creating a separate environment for work-related issues. PS.:我避免为与工作相关的问题创建一个单独的环境。

EDIT编辑

I did the manual approach:我做了手动方法:

$ wget https://pypi.python.org/packages/13/7f/735fbc0dd78c91ad3693cfdfe5c91603899fc8e24909f935d46d2fde6559/vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl
$ sudo pip3 install vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl
vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl is not a supported wheel on this platform.

Which I don't know what's causing.我不知道是什么原因造成的。 I've tried to follow this answer but I can't make the first pep command work.我试图遵循这个答案,但我无法使第一个pep命令起作用。

Could not find a version that satisfies the requirement vtk (from versions: )找不到满足 vtk 要求的版本(来自版本:)

Among the currently released files there are no binaries for Python 2.7 and there is source code.当前发布的文件中,没有 Python 2.7 的二进制文件,并且有源代码。 Either you should try a different version of Python (2.7, 3.4-3.6) or compile/install VTK from sources .您应该尝试不同版本的 Python(2.7、3.4-3.6)或从源代码编译/安装VTK

vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl is not a supported wheel on this platform. vtk-8.1.0-cp27-cp27mu-manylinux1_x86_64.whl 在此平台上不受支持。

You're trying to install a Python 2.7 binary wheel for Python 3.7.您正在尝试为 Python 3.7 安装 Python 2.7 二进制轮。 That's impossible.这不可能。

该轮子尚未在 pip 上发布,您可以直接从 vtk.org 下载并安装一个: https ://vtk.org/download/

你可以手动编译你想要的VTK版本包,放到dist-Packages目录下。我有一个具体的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM