Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mayavi does not recongise installed Traits. #483

Open
Make42 opened this issue Jan 31, 2017 · 7 comments
Open

Mayavi does not recongise installed Traits. #483

Make42 opened this issue Jan 31, 2017 · 7 comments

Comments

@Make42
Copy link

Make42 commented Jan 31, 2017

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 <pkg_name>. 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?

@bhavesh2109
Copy link
Contributor

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.

@Make42
Copy link
Author

Make42 commented Feb 17, 2017

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

@garvita-tiwari
Copy link

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.

@jclevesque
Copy link

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.

@steelec
Copy link

steelec commented Mar 19, 2018

@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

@jclevesque
Copy link

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

@nitheeshkl
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants