MayaVi: mlab segfaults on display

I'm trying to learn MayaVi but get stuck when opening shapes.

Displaying numbers in mlab only leads to segfault. It doesn't seem to matter what I'm plotting, so I think the problem is with the display action, and not with the object I'm trying to display. For instance:

import numpy as np from mayavi import mlab x = y = np.arange(-5, 5, 1) s = np.meshgrid(x, y) mlab.surf(s) 

leads to an error:

 Segmentation fault (core dumped) 

I am using Python 2.7.3, EPD 7.3-1 (64-bit) on Linux.

EDIT: I get a different error if I try to display an image that is one of my goals.

 import numpy as np from mayavi import mlab from PIL import Image img = Image.open('milkyway.png') mlab.imshow(img) 

leads to

 Fatal error in __driConfigOptions line 108393789, column 108392770: parsing finished. Abort (core dumped) 

EDIT2: Well, this is definitely a problem when opening numbers, because if I just check:

 from mayavi import mlab mlab.figure() 

I get the initial error (segfault).

+4
source share
1 answer

I do not use Enthought, but I got similar segfault errors and found help here:

https://github.com/enthought/mayavi/issues/450

They say that the compatibility problem is between Qt4 (using VTK) and Qt5 (using Mayavi) and it is recommended that you switch to wx. To do this, run the following command in the terminal:

 export ETS_TOOLKIT=wx 

Then you can run Enthough or your Python from the same terminal.

If this works, you can also consider adding the above line to the ~ / .profile.d file so that the export is automatically performed when the terminal starts. How it can automatically be included in Enthought, I do not know, sorry.

I hope this helps, Mayavi is good after launch!

0
source

Source: https://habr.com/ru/post/1491516/


All Articles