DLL load failed while importing vtkIOOCCT

I have built the VTK with OpenCascade support by following this(Building VTK with OpenCascade support), and I have set site-packages directory in the PYTHONPATH in my System Variables
When I try to import vtk I get error


While building OpenCascade and VTK using Cmake I did not get any errors apart from few warnings. So I am not sure are there any dependencies of vtkIOOCCT.dll which are missing.
I want to use vtkOCCTReader at the end.
Thanks

On windows, make sure to add path to the directory containing the DLLs of opencascade to the sys.path using os.add_dll_directory

Hi, I tried this but still face the same error…I have even added the paths in System Variables. This is my code

If I comment vtkIOOCT(#from vtkmodules.vtkIOOCCT import *) line in vtk.py present in site-packages, the code runs and displays the right output

image

Then it must be because of a depenency of OpenCascade, you can check using GitHub - lucasg/Dependencies: A rewrite of the old legacy software "depends.exe" in C# for Windows devs to troubleshoot dll load dependencies issues.

1 Like

Hi @mwestphal
I used DepedenciesGui and selected vtkIOOCCT-9.4.dll and got these results


There are several dependencies with incorrect in checksum, is there anything I need to be looking at…

Thanks in advance…

I think you only need vtk\install\bin and win64\vc14\bin in your sys.path