如何安装 Mayavi Trait 后端?

How to install Mayavi Trait backends?

OS: Linux Kubuntu 14.4.5

Python: Python 3.5.2 :: Continuum Analytics, Inc.


我尝试将 Mayavi 安装到我的 anaconda 环境中:

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 的示例时,我收到错误消息

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. wxPython: http://www.wxpython.org/ PyQT: http://www.riverbankcomputing.co.uk/software/pyqt/intro

我在网上搜索并试图找到任何要设置的东西,但找不到任何东西。

http://docs.enthought.com/mayavi/mayavi/installation.html?highlight=installation 我知道我可以使用 pip install mayavi 通过 pip 安装它,但这只会导致 "Requirement already satisfied" 的消息,其中

Requirement already satisfied: traits in /anaconda2/envs/myenv/lib/python3.5/site-packages (from mayavi)

怎么办?

以下步骤对我有用(在 python2 环境中):

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

可能缺少 OpenGL 或任何显卡驱动程序。因为我几天前遇到的同样错误是在 windows server 2012 in hyper-v.

在 windows 中,您会使用 christopher gholke 的 windows 车轮。在 windows 中,您需要 VC 2015 14.0 来编译特征库。也许你需要挖掘你需要安装什么来编译特征库。