Ubuntu下 python3 安装Mayavi

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.
``
这是因为我电脑里qt5与mayavi不兼容产生,
接下来通过:
sudo apt-get install python3-pyside`
安装pyside后,再执行测试代码,发现问题解决。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值