python wheel created on OS X leads to broken python module
I'm trying to use the wheel creation process in the current master (pre-9.0) with macports python 3.8.2. There's also an ongoing discussion at text. I can enable VTK_BUILD_WHEEL
in cmake, compile, and do python setup.py bdist_wheel
apparently successfully, but the resulting wheel leads to a broken module. When I try to import vtk
, I get
Traceback (most recent call last):
File "/Users/bernstei/Library/Python/3.8/lib/python/site-packages/vtkmodules/__init__.py", line 13, in <module>
from . import vtkCommonCore
ImportError: dlopen(/Users/bernstei/Library/Python/3.8/lib/python/site-packages/vtkmodules/vtkCommonCore.cpython-38-darwin.so, 2): Library not loaded: @rpath/libvtkWrappingPythonCore.1.dylib
Referenced from: /Users/bernstei/Library/Python/3.8/lib/python/site-packages/vtkmodules/vtkCommonCore.cpython-38-darwin.so
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bernstei/Library/Python/3.8/lib/python/site-packages/vtk.py", line 30, in <module>
all_m = importlib.import_module('vtkmodules.all')
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/bernstei/Library/Python/3.8/lib/python/site-packages/vtkmodules/__init__.py", line 15, in <module>
import _vtkmodules_static
ModuleNotFoundError: No module named '_vtkmodules_static'
If I add $HOME/Library/Python/3.8/lib/python/site-packages/vtkmodule
to DYLD_LIBRARY_PATH it works, suggesting to me that the libraries are not in the expected place (either in the wrong place, or not correctly indicating to python or the dyld loader where they are).