CadQuery / ocp-build-system

A system to build Python wheel PyPI packages for OCP.
Apache License 2.0
8 stars 11 forks source link

cadquery and vtk compatibility #23

Open msavtchouk-pf opened 8 months ago

msavtchouk-pf commented 8 months ago

Hi all We are using the latest pip-installable cadquery and we also recently added a new dependency (vtk==9.3.0) Just importing those two in the same file: import cadquery import vkt Results in the following error: ImportError: Initialization failed for vtkWebCore, not compatible with vtkmodules.vtkCommonCore

Since that the vtk version, used by cadquery is incompatible with vtk==9.3.0. I could not find any pointers how to resolve this so far. Any help would be appreciated!

msavtchouk-pf commented 8 months ago

Update: it is possible that our build system is not resolving the versions correctly. I am waiting for response from them to confirm that.

jmwright commented 8 months ago

Could be related to this. I think that eventually we will remove VTK from the OCP wheels and have it as a dependency, but it is bundled for now. If conda is an option in your environment, you could try using that to make sure that there is not a deeper incompatibility that has been introduced in VTK 9.3.0 reference.

jmwright commented 8 months ago

@msavtchouk-pf Can you manually install the appropriate wheel artifact from here and see if it fixes your problem (and if it even works correctly for you)? I removed the embedded version of VTK that we were building. I tested the Python 3.10 wheel on Debian and that at least works.

mathstuf commented 7 months ago

FWIW, this error in VTK comes when a VTK Python module is loaded without VTK's Python glue code being initialized. Where did this VTK come from?

jmwright commented 6 months ago

@mathstuf It is built from source in this workflow.

mathstuf commented 6 months ago

I think this is missing auditwheel (Linux) and delvewheel (Windows) at least to fix up the wheels to contain the appropriate VTK libraries. It seems like some other VTK build may be getting loaded via PATH or LD_LIBRARY_PATH.