使用 pip 安装 mayavi - 构建 TVTK 类...断言失败

zij*_*eng 0 python mayavi

我一直在尝试在优胜美地安装 mayavi。我已经安装了 Numpy、VTK、wxPython 和 configobj。当我运行时sudo pip install mayavi,它显示以下错误消息:

\n\n
Running setup.py install for mayavi\n    ----------------------------------------------------------------------\n    Building TVTK classes...Assertion failed: ("pre: not_empty" && !IsEmpty()), function\nGetAttributesToInterpolate, file /tmp/vtk-MvPwfE/VTK-6.1.0/Common/DataModel\n/vtkGenericAttributeCollection.cxx, line 453.\n    Complete output from command /usr/local/opt/python/bin/python2.7 -c "import\nsetuptools,tokenize;__file__=\'/private/tmp/pip_build_root/mayavi/setup.py\';\nexec(compile(getattr(tokenize, \'open\', open)(__file__).read().replace(\'\\r\\n\', \'\\n\'),\n__file__, \'exec\'))" install --record /tmp/pip-haj8cd-record/install-record.txt \n--single-version-externally-managed --compile:\n    running install\nrunning build\n
Run Code Online (Sandbox Code Playgroud)\n\n

我不知道如何处理这个问题。

\n\n

以下内容可能会有所帮助。

\n\n
{20:06:44}~/test \xe2\x9e\xad which pip\n/usr/local/bin/pip\n{20:07:13}~/test \xe2\x9e\xad which python\n/usr/local/bin/python\n{20:07:25}~/test \xe2\x9e\xad python\nPython 2.7.9 (default, Dec 19 2014, 06:00:59) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin\nType "help", "copyright", "credits" or "license" for more information.\n>>> import vtk\n>>> vtk\n<module \'vtk\' from \'/usr/local/lib/python2.7/site-packages/vtk/__init__.pyc\'>\n>>> \n
Run Code Online (Sandbox Code Playgroud)\n

max*_*rts 5

我通过 pip 解决了同样的问题:

pip install git+https://github.com/enthought/mayavi.git
Run Code Online (Sandbox Code Playgroud)

使用这种格式,您可以使用 pip 从特定的 git 存储库进行安装。一般来说:

pip install git+(web address of git repo)
Run Code Online (Sandbox Code Playgroud)