enthought / mayavi

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

mlab not working with mayavi in Ubuntu 16.04 (xenial) #453

Open tom-wood opened 7 years ago

tom-wood commented 7 years ago

I've installed mayavi using apt in Ubuntu 16.04 [sudo apt install mayavi2]. Unfortunately when trying to use, mlab seems to fail. I get the following error when running ipython --gui=qt: In[1]: from mayavi import mlab (python:127406): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init()

When running ipython --gui=wx: In[1]: from mayavi import mlab In[2]: mlab.figure() ipython:127461): Gdk-WARNING **: /build/gtk+2.0-KsZKkB/gtk+2.0-2.24.30/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window (this warning repeats 7 times before:) Out[2]: < mayavi.core.scene.Scene at 0x7f14001eaef0>

I've run the nosetests for mayavi/tests and tvtk/tests and have attached the outputs along with the output for typing mayavi2 -t on the command line. mayavi2-t.txt nose_mayavi.txt nose_tvtk.txt

I've reproduced the same error(s) in Linux Mint 18 (Sarah), which is built on top of Ubuntu 16.04. The mayavi2 was just downloaded from the universe repository, so it's version 4.4.3-2.1.

Any help much appreciated.

RansML commented 7 years ago

I have the same issue as @tom-wood when loading from mayavi import mlab Gdk-WARNING **: /build/gtk+2.0-KsZKkB/gtk+2.0-2.24.30/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window

These are just warnings, not error msgs. The program runs smoothly.

gockolori commented 6 years ago

I have similar problems being unable to import mlab: I install mayavi with sudo apt-get install mayavi

and when I try to import with "from mayavi import mlab" I get:

In [61]: from mayavi import mlab Changing backend to Qt for Mayavi

ERROR: execution aborted

In [62]: %gui inline In [61]: %gui qtTraceback (most recent call last):

File "", line 1, in from mayavi import mlab

File "/usr/local/lib/python2.7/dist-packages/mayavi/mlab.py", line 27, in from mayavi.tools.camera import view, roll, yaw, pitch, move

File "/usr/local/lib/python2.7/dist-packages/mayavi/tools/camera.py", line 25, in from .engine_manager import get_engine

File "/usr/local/lib/python2.7/dist-packages/mayavi/tools/engine_manager.py", line 14, in from mayavi.core.engine import Engine

File "/usr/local/lib/python2.7/dist-packages/mayavi/core/engine.py", line 28, in from mayavi.core.base import Base

File "/usr/local/lib/python2.7/dist-packages/mayavi/core/base.py", line 19, in from tvtk.pyface.tvtk_scene import TVTKScene

File "/usr/local/lib/python2.7/dist-packages/tvtk/pyface/tvtk_scene.py", line 28, in from tvtk.pyface import light_manager

File "/usr/local/lib/python2.7/dist-packages/tvtk/pyface/light_manager.py", line 130, in class CameraLight(HasTraits):

File "/usr/local/lib/python2.7/dist-packages/tvtk/pyface/light_manager.py", line 146, in CameraLight source = Instance(tvtk.Light, ())

File "tvtk_classes/tvtk_helper.py", line 206, in Light = property(lambda self: get_class('Light'))

File "tvtk_classes/tvtk_helper.py", line 36, in get_class mod = get_module(fname)

File "tvtk_classes/tvtk_helper.py", line 28, in get_module mod = import('tvtk.tvtk_classes.%s'%fname, globals(), locals(), [fname])

File "tvtk_classes/light.py", line 12, in

File "/usr/local/lib/python2.7/dist-packages/tvtk/array_handler.py", line 28, in from tvtk.array_ext import set_id_type_array

ImportError: cannot import name set_id_type_array