问题描述
操作系统::Linux Kubuntu 14.4.5
OS: Linux Kubuntu 14.4.5
Python: Python 3.5.2 :: Continuum Analytics,Inc.
Python: Python 3.5.2 :: Continuum Analytics, Inc.
我试图将Mayavi安装到我的anaconda环境中:
I tried to install Mayavi into my anaconda environment:
conda install -c menpo mayavi=4.5.0
conda install -c anaconda wxpython=3.0.0.0
conda install pyqt
conda install qt
但是当我尝试从 http://docs.enthought运行示例时.com/mayavi/mayavi/auto/example_surface_from_irregular_data.html 我收到错误消息
But when I try to run the example from http://docs.enthought.com/mayavi/mayavi/auto/example_surface_from_irregular_data.html I get the error message
ImportError: Could not import backend for traits
解释:
如果您执行了源签出,请确保运行'python setup.py 安装"中的Traits,TraitsGUI和您选择的Traits后端.
If you performed a source checkout, be sure to run 'python setup.py install' in Traits, TraitsGUI, and the Traits backend of your choice.
还要确保已安装wxPython或PyQT. wxPython: http://www.wxpython.org/ PyQT: http://www.riverbankcomputing.co.uk/software/pyqt/intro
Also make sure that either wxPython or PyQT is installed. wxPython: http://www.wxpython.org/ PyQT: http://www.riverbankcomputing.co.uk/software/pyqt/intro
我在网上搜索并尝试找到要设置的任何内容,但找不到任何内容.
I searched the web and tried to find anything to setup, but couldn't find anything.
来自 http://docs.enthought.com/mayavi/mayavi/installation.html?highlight=installation 我知道可以使用pip install mayavi
通过pip安装它,但这仅导致出现要求已满足"消息,其中是
From http://docs.enthought.com/mayavi/mayavi/installation.html?highlight=installation I got that I could install it via pip with pip install mayavi
, but that resulted only in the messages that "Requirement already satisfied", among which is
该怎么办?
推荐答案
以下步骤对我有用(在python2环境中):
The following steps worked for me (in a python2 environment):
conda create -yn mayavitest
source activate mayavitest
conda install -yc menpo mayavi=4.5.0
conda install -y pyside
conda install qt
ETS_TOOLKIT=qt4 python /path/to/mayavi-example.py
安装pyside可能会使qt降级,这就是为什么需要再次安装qt的原因.
The installation of pyside might downgrade qt, that is why qt needs to be installed again.
这篇关于如何安装Mayavi Trait后端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!