2014-12-29 157 views
0

我一直试图在优胜美地安装mayavi。我已经安装了Numpy,VTK,wxPython和configobj。当我运行sudo pip install mayavi,它显示了以下错误信息:用pip安装mayavi - 建立TVTK课程......声明失败

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

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

以下可能会有帮助。

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

回答

0

我git克隆mayavi,并运行python setup.py install。有用。

+0

不错。请接受你自己的答案,这样问题就不会被认为是没有答案的。 –

+0

@JonathanMarch谢谢。我只能在两天内接受我的回答。我会那么做。 – zijuexiansheng

+0

git clone https://github.com/enthought/mayavi; pip install mayavi –

0

我在使用pypi中的tar和pip时遇到了类似的问题。我从Github下载了当前的zip文件并将其展开到一个临时目录中。由于某种原因,我必须在安装完成之前运行两次'python setup.py install'命令。 mayavi模块现在工作正常。我在openSUSE 13.2上运行。

2

我解决了同样的问题,通过与PIP:

pip install git+https://github.com/enthought/mayavi.git 

使用这种格式,可以使用画中画从特定的Git回购安装。一般:

pip install git+(web address of git repo) 
+0

虽然这个链接可能回答这个问题,但最好在这里包含答案的重要部分,并提供供参考的链接。如果链接页面更改,则仅链接答案可能会失效。 – skrrgwasme

+0

有效。我编辑了我的答案。 – maxroberts