enthought / enthought/mayavi

mlab import fails on macOS 11 Py3.9

Open
#1,028 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

Hi,

I am currently trying to get mayavi to work under a macOS 11 / Python 3.9 env. Since there are no wheels available, I built vtk from master myself, so im getting `vtk==9.0.20210422`.
I can subsequently `import vtk` and also install mayavi from either master (`python setup.py bdist_wheel`) or just `pip install mayavi` with no apparent errors.

I can then start `mayavi2` with just some warnings (cant make much of that honestly):
```python
multiple 'traitsui.toolkits' plugins found for toolkit 'qt4': traitsui.qt4, traitsui.qt4
multiple 'tvtk.toolkits' plugins found for toolkit 'qt4': tvtk.pyface.ui.qt4.init, tvtk.pyface.ui.qt4.init
```

However, trying a `from mayavi import mlab` yields the traceback below. I just scanned the issues and following #939 this should (?) be resolved, however it is not for me...Is this fix incoming and not merged or is this a new bug?

```python
----> 1 from mayavi import mlab

/usr/local/lib/python3.9/site-packages/mayavi/mlab.py in
32
33
---> 34 from .tools.helper_functions import contour3d, test_contour3d, \
35 quiver3d, test_quiver3d, test_quiver3d_2d_data, \
36 points3d, test_points3d, test_molecule, \

/usr/local/lib/python3.9/site-packages/mayavi/tools/helper_functions.py in
14 # License: BSD Style.
15
---> 16 from .modules import VectorsFactory, StreamlineFactory, GlyphFactory, \
17 IsoSurfaceFactory, SurfaceFactory, ContourSurfaceFactory, \
18 ImageActorFactory, ImagePlaneWidgetFactory, glyph_mode_dict

/usr/local/lib/python3.9/site-packages/mayavi/tools/modules.py in
25 from . import tools
26 from .pipe_base import PipeFactory, make_function
---> 27 from .filters import new_class
28
29

/usr/local/lib/python3.9/site-packages/mayavi/tools/filters.py in
16 from tvtk.common import camel2enthought
17 from tvtk.api import tvtk
---> 18 import mayavi.filters.api as filters
19 from mayavi.core.registry import registry
20 from .pipe_base import PipeFactory, make_function

/usr/local/lib/python3.9/site-packages/mayavi/filters/api.py in
17 from .elevation_filter import ElevationFilter
18 from .extract_edges import ExtractEdges
---> 19 from .extract_grid import ExtractGrid
20 from .extract_tensor_components import ExtractTensorComponents
21 from .extract_unstructured_grid import ExtractUnstructuredGrid

/usr/local/lib/python3.9/site-packages/mayavi/filters/extract_grid.py in
13
14 from tvtk.api import tvtk
---> 15 from tvtk.vtk_module import VTK_MAJOR_VERSION
16
17 # Local imports

ImportError: cannot import name 'VTK_MAJOR_VERSION' from 'tvtk.vtk_module' (/usr/local/lib/python3.9/site-packages/tvtk/vtk_module.py)

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.