Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Mayavi Trait backends?

OS: Linux Kubuntu 14.4.5

Python: Python 3.5.2 :: Continuum Analytics, Inc.


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

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

with the explanation:

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

I searched the web and tried to find anything to setup, but couldn't find anything.

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

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

What to do?

like image 428
Make42 Avatar asked Jan 31 '17 14:01

Make42


1 Answers

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

The installation of pyside might downgrade qt, that is why qt needs to be installed again.

like image 167
Nehal J Wani Avatar answered Oct 12 '22 01:10

Nehal J Wani