Mayavi: Mayavi does not recongise installed Traits.

Created on 31 Jan 2017  ·  7Comments  ·  Source: enthought/mayavi

I tried to install Mayavi into my anaconda environment (python 3.5):

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 get the same error message if I just try to run mayavi2 from the console.

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)

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

Most helpful comment

What helped was to install conda install -c conda-forge pyside=1.2.4

All 7 comments

Could you let us know the version of qt installed?
Currently Mayavi does not support python-qt5.
If you have installed python-qt5 try removing it and installing python-qt4 or creating an environment with python-qt4 and let us know your results.
You might want to look into this too #448 for creating an environment with python-qt4.

What helped was to install conda install -c conda-forge pyside=1.2.4

after using the solution given by @Make42 , I got following warning
FutureWarning: Conversion of the second argument of issubdtype from complex to np.complexfloating is deprecated. In future, it will be treated as np.complex128 == np.dtype(complex).type.
assert not numpy.issubdtype(z.dtype, complex),

and then nothing is displayed on mayavi figure.

Also not working on Ubuntu 16.04, doesn't matter if I use wx or qt, both fail with same error. Python 3.5.2, wx version 4.0.1, traits version 4.6.0, and mayavi 4.5.0.

@jclevesque , I had similar issues with Ubuntu 16.04 and python=3.5 and finally spent time tracking it down. My issue was that I had installed some packages that were interfering with the conda install. The solution was to purge my install of mayavi (using apt-get). I also uninstalled pip packages for vtk and qt at the same time since my anaconda environment somehow always ended up pointing at them rather than the ones installed through anaconda, though that may not be necessary on your system.
as above, the following then worked out of the box:

conda create -n py3p5 python=3.5 qt=4
source activate py3p5
conda install -c menpo mayavi

For inline plotting, i had to increase the iopub_data_rate_limit to have it work within a jupyter notebook

jupyter notebook --NotebookApp.iopub_data_rate_limit=1.0e10

I fixed it by updating to the development packages from github. Had to use the master branch for mayavi, traits and pyface.

had similar issue. @steelec 's steps worked for me. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aestrivex picture aestrivex  ·  9Comments

stefanoborini picture stefanoborini  ·  11Comments

indranilsinharoy picture indranilsinharoy  ·  9Comments

kitchoi picture kitchoi  ·  10Comments

yassersouri picture yassersouri  ·  5Comments