mayavi icon indicating copy to clipboard operation
mayavi copied to clipboard

Imported VTK version does not match the one used to build the TVTK classes

Open harrandt opened this issue 9 months ago • 1 comments

When building mayavi in a Docker environment (clean venv) I get a notification

WARNING: Imported VTK version (9.2) does not match the one used
         to build the TVTK classes (9.4). This may cause problems.
         Please rebuild TVTK.

In the end the import fails with some of the VTK objects not present.

As far as I understand it, the pyproject.toml installs the newest vtk on pip:

[build-system]
requires = [
    "oldest-supported-numpy",
    "setuptools",
    "vtk", # <-----
    "wheel"
]

But that newest vtk may not be supported in tvtk/vtk_module.py yet

if vtk_version == '9.2.0': ...
if vtk_version.startswith('9.3'): ...
if vtk_version in ['9.4.0', '9.4.1']:...

One solution to this might be to add the highest supported vtk version to pyproject.toml like

"vtk~=9.4.0",
"vtk>=7.4.0,<9.4.0"

Will there be a new release on pip in the near future that supports the latest fixes?

harrandt avatar Feb 21 '25 14:02 harrandt

+1 for restricting the highest supported version. While 9.4 works with mayavi 4.8.3 by now, the newest vtk 9.5 leads to issues. I'm trying to exclude this version with https://github.com/enthought/mayavi/pull/1351.

drocheam avatar Jul 08 '25 12:07 drocheam