为 python 3 安装 VTK

Mar*_*Mag 5 homebrew vtk python-3.x

我在 OSX (Mojave) 下使用 Python 3.7.0。为了安装一个python包来可视化结果(Mayavi),我需要安装带有python 3绑定的vtk。我已经用 brew 安装了 python 3.7.0

我尝试了以下操作:

  • python3 -m pip install vtk. 我得到:

    Collecting vtk
    Could not find a version that satisfies the requirement vtk (from versions: )
    No matching distribution found for vtk
    
    Run Code Online (Sandbox Code Playgroud)
  • brew install vtk --without-python@2不允许安装 python 3 包装器

  • brew install vtk --with-python --without-python@2 给出:

    [10%] Built target vtkCommonMath
    make: *** [all] Error 2
    
    READ THIS: https://docs.brew.sh/Troubleshooting
    
    Run Code Online (Sandbox Code Playgroud)
  • 我也尝试按照本教程进行操作,VTK_WRAP_TCL在 ccmake 的可用选项中找不到。我设置了以下选项:

    • PYTHON_EXECUTABLE/usr/local/bin/python3

    • PYTHON_INCLUDE_DIR/usr/local/Frameworks/Python.framework/Versions/3.7/include/python3.7m

    编译 VTK 没问题。但是当我尝试编译包装器时,sudo make install给出:

    [100%] Built target vtkpython
    Install the project...
    -- Install configuration: "Debug"
    -- Installing: /usr/lib/libvtkCommonCorePython37D-8.2.1.dylib
    CMake Error at cmake_install.cmake:36 (file):
      file INSTALL cannot copy file "/Users/marco.magliulo/Software/vtkBuild/lib/libvtkCommonCorePython37D-8.2.1.dylib"
      to "/usr/lib/libvtkCommonCorePython37D-8.2.1.dylib".
    
    Run Code Online (Sandbox Code Playgroud)

有没有一种简单的方法可以获取我没有尝试过的 python 3 包装器?在我所做的不同尝试中,我是否遗漏了一些明显的东西?