ubuntu下python2.7 安装mayavi
安装简便:
sudo apt-get install python-dev
sudo apt-get install python-vtk
sudo pip install mayavi
ubuntu下python3 安装mayavi
如果使用sudo pip3 install mayavi
会提示vtk不存在的错误,尝试sudo apt-get install vtk
安装可以成功,但是再执行sudo pip3 install mayavi 会报错installing Mayavi with pip - no module named ‘vtkOpenGLKitPython’
所以这种方式不可用。
因此,尝试直接通过源码进行编译的方式,成功安装使用。
编译过程参考:
http://blog.csdn.net/ouening/article/details/76038702
按照如上方式,可以成功安装mayavi,但是在使用时出现如下错误:
“`ImportError: Could not import backend for traits
Make sure that you have either the TraitsBackendWx or the TraitsBackendQt
projects installed. If you installed Mayavi with easy_install, try
easy_install . easy_install Mayavi[app] will also work.
If you performed a source checkout, be sure to run ‘python setup.py install’
in Traits, TraitsGUI, and the Traits backend of your choice.
Also make sure that either wxPython or PyQT is installed.
`` sudo apt-get install python3-pyside`
这是因为我电脑里qt5与mayavi不兼容产生,
接下来通过:
安装pyside后,再执行测试代码,发现问题解决。

在Ubuntu系统中,使用Python3安装Mayavi时遇到一些问题。通过pip安装会提示错误,需要通过源码编译安装。参照特定教程进行编译后,虽然能成功安装,但在使用时会出现导入错误。解决方法是安装pyside,之后测试代码运行正常。

944

被折叠的 条评论
为什么被折叠?



