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

No module named 'tvtk.custom.light' #1333

Open
Dharmesh946 opened this issue Feb 12, 2025 · 1 comment
Open

No module named 'tvtk.custom.light' #1333

Dharmesh946 opened this issue Feb 12, 2025 · 1 comment

Comments

@Dharmesh946
Copy link

Hi.

I'm running Python 3.10.12 under ubuntu 22.04.
I installed mayavi through pip install mayavi, followed by pip3 install PyQt5

In any python script, on from mayavi import mlab I've got the following errors:

Exception has occurred: ValueError
numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
ModuleNotFoundError: No module named 'tvtk.custom.light'

During handling of the above exception, another exception occurred:

File "/.py", line 19, in
from mayavi import mlab
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

from pip freeze:

mayavi==4.8.2
numpy==2.0.2
PyQt5==5.15.11
vtk==9.4.1

Running mayavi2 also fails:

Traceback (most recent call last):
File "tvtk_classes/tvtk_helper.py", line 22, in get_module
ModuleNotFoundError: No module named 'tvtk.custom.light'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<path_to_env>/bin/mayavi2", line 5, in
from mayavi.scripts.mayavi2 import main
File "<path_to_env>/lib/python3.10/site-packages/mayavi/scripts/mayavi2.py", line 462, in
from mayavi.plugins.app import Mayavi, setup_logger
File "<path_to_env>/lib/python3.10/site-packages/mayavi/plugins/app.py", line 19, in
from .mayavi_workbench_application import MayaviWorkbenchApplication
File "<path_to_env>/lib/python3.10/site-packages/mayavi/plugins/mayavi_workbench_application.py", line 17, in
import mayavi.api
File "<path_to_env>/lib/python3.10/site-packages/mayavi/api.py", line 2, in
from mayavi.core.engine import Engine
File "<path_to_env>/lib/python3.10/site-packages/mayavi/core/engine.py", line 27, in
from mayavi.core.base import Base
File "<path_to_env>/lib/python3.10/site-packages/mayavi/core/base.py", line 19, in
from tvtk.pyface.tvtk_scene import TVTKScene
File "<path_to_env>/lib/python3.10/site-packages/tvtk/pyface/tvtk_scene.py", line 25, in
from tvtk.pyface import light_manager
File "<path_to_env>/lib/python3.10/site-packages/tvtk/pyface/light_manager.py", line 130, in
class CameraLight(HasTraits):
File "<path_to_env>/lib/python3.10/site-packages/tvtk/pyface/light_manager.py", line 146, in CameraLight
source = Instance(tvtk.Light, ())
File "tvtk_classes/tvtk_helper.py", line 297, in
File "tvtk_classes/tvtk_helper.py", line 47, in get_class
File "tvtk_classes/tvtk_helper.py", line 28, in get_module
File "tvtk_classes/light.py", line 12, in
File "<path_to_env>/lib/python3.10/site-packages/tvtk/array_handler.py", line 29, in
from tvtk.array_ext import set_id_type_array
File "array_ext.pyx", line 1, in init array_ext
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

@lesbianlizard
Copy link

Same problem with mayavi 4.8.2 and numpy 2.2.3. Based on some stuff I read here, I tried downgrading numpy to version 1.26.4, which seems to be a functional workaround.

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

2 participants