enthought / mayavi

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

Installation of Cadquery results in import error on Mayavi #1280

Open KwentiN-ui opened 8 months ago

KwentiN-ui commented 8 months ago

Problem description

Installation of the Cadquery Package through PIP breaks the import of Mayavi inside Python Scripts.

$ pip install mayavi
$ pip install PyQt5

works fine until

$ pip install cadquery

Which results in this error message when running from mayavi import mlab:

Traceback (most recent call last):
  File "c:\Users\quent\Downloads\projektion\test2.py", line 1, in <module>
    from mayavi import mlab
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\mayavi\mlab.py", line 16, in <module>
    from mayavi.tools.camera import view, roll, yaw, pitch, move
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\mayavi\tools\camera.py", line 24, in <module>
    from .engine_manager import get_engine
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\mayavi\tools\engine_manager.py", line 14, in <module>
    from mayavi.core.registry import registry
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\mayavi\core\registry.py", line 16, in <module>
    from mayavi.core.metadata import Metadata, import_symbol
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\mayavi\core\metadata.py", line 11, in <module>
    from mayavi.core.pipeline_info import PipelineInfo
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\mayavi\core\pipeline_info.py", line 12, in <module>
    from .utils import get_tvtk_dataset_name
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\mayavi\core\utils.py", line 2, in <module>
    import vtk
  File "C:\Users\quent\AppData\Local\Programs\Python\Python311\Lib\site-packages\vtk.py", line 43, in <module>
    from vtkmodules.vtkRenderingVolumeAMR import *
ImportError: Initialization failed for vtkRenderingVolumeAMR, not compatible with vtkmodules.vtkImagingCore

This error occured on 2 seperate machines running Python 3.10 and 3.11. I assume this is a poblem with mayavi, as cadquery is running fine.
Unfortunately I need Cadquery and Mayavi inside the same environment , so I can't really seperate them into environments. I already tried a fresh reinstall of Python which results in Mayavi working until I install Cadquery.
Any help would be appreciated!

quentinodigiminlabs commented 4 months ago

Hi there, I do not know if you were able to find a workaround but if yes I am interested as I face the same problem

KwentiN-ui commented 4 months ago

Hi there, I do not know if you were able to find a workaround but if yes I am interested as I face the same problem

I did not I'm afraid. I just avoid installing them at the same time :(