我在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
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
我也尝试遵循this tutorial,但是在ccmake的可用选项中找不到VTK_WRAP_TCL
。我设置了以下选项:
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".
有没有一种简单的方法来获取我没有尝试过的python 3包装器? 我进行的各种尝试中是否有明显的我缺少的东西?