enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 284 forks source link

Error in importing mlab #445

Open adehgha opened 7 years ago

adehgha commented 7 years ago

After installing all the requirements, I cloned the repo and ran the install script. It went through the installation. I can import the mayavi package in python but I can not import the mlab from within the mayavi package. It complains about not finding the pyface.tvtk_scence.

from mayavi import mlab
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.5.1.dev0-py2.7-linux-x86_64.egg/mayavi/mlab.py", line 27, in <module>
    from mayavi.tools.camera import view, roll, yaw, pitch, move
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.5.1.dev0-py2.7-linux-x86_64.egg/mayavi/tools/camera.py", line 25, in <module>
    from .engine_manager import get_engine
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.5.1.dev0-py2.7-linux-x86_64.egg/mayavi/tools/engine_manager.py", line 14, in <module>
    from mayavi.core.engine import Engine
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.5.1.dev0-py2.7-linux-x86_64.egg/mayavi/core/engine.py", line 28, in <module>
    from mayavi.core.base import Base
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.5.1.dev0-py2.7-linux-x86_64.egg/mayavi/core/base.py", line 19, in <module>
    from tvtk.pyface.tvtk_scene import TVTKScene
ImportError: No module named pyface.tvtk_scene
kitchoi commented 7 years ago

Can you provide your setuptools version please? I suspect PR #444 would fix this issue.

adehgha commented 7 years ago
$ easy_install --version
setuptools 28.2.0 from /usr/local/lib/python2.7/dist-packages (Python 2.7)
prabhuramachandran commented 7 years ago

@adehgha -- I've merged #444, can you update your cloned repository and try again and let us know if this works for you please? Thanks!

adehgha commented 7 years ago

@prabhuramachandran: The merge actually resolved the error. So now I can import the mlab successfully. However mayavi still doesn't work and terminates with a segmentation fault. I think you can close this issue and I will open up another issue to resolve the segmentation fault.

MMesch commented 7 years ago

I have the same problem with anaconda mayavi2 installed with conda install -c menpo mayavi

Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:53:06) 
Type "copyright", "credits" or "license" for more information.

IPython 4.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from mayavi import mlab
Segmentation fault (core dumped)

ETS_TOOLKIT=null fixed the import issue for me as mentioned in #439

MMesch commented 7 years ago

another comment: anaconda mayavi should have as dependency e.g. this:

conda install qt=4.8.7
conda install pyqt=4.11.4

QT v5 fails and is installed by default by anaconda, also fixed in: #448