View Revisions: Issue #4554

Summary 0004554: rpath not set for macOS binaries in 4.9.0
Revision 2018-05-23 04:15 by jcfr
Description

Running a Python script with SlicerPython on macOS, I run into this error:

Traceback (most recent call last):
  File "HelloWorld.py", line 1, in <module>
    import vtk
  File "/Applications/Slicer.app/Contents/bin/Python/vtk.py", line 12, in <module>
    all_m = importlib.import_module('vtkmodules.all')
  File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Applications/Slicer.app/Contents/bin/Python/vtkmodules/all.py", line 34, in <module>
    from .vtkRenderingQt import *
  File "/Applications/Slicer.app/Contents/bin/Python/vtkmodules/vtkRenderingQt.py", line 9, in <module>
    from vtkRenderingQtPython import *
ImportError: dlopen(/Applications/Slicer.app/Contents/lib/Slicer-4.9/vtkRenderingQtPython.so, 2): Library not loaded: @rpath/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
  Referenced from: /Applications/Slicer.app/Contents/lib/Slicer-4.9/libvtkRenderingQt-9.0.1.dylib
  Reason: image not found

This can be fixed by first applying the fix in https://issues.slicer.org/view.php?id=4553 and then running the following:

install_name_tool -add_rpath "@executable_path/.." /Applications/Slicer.app/Contents/bin/python-real

Perhaps this step should be added to the packaging process on macOS.

Revision 2018-05-15 10:19 by cquammen
Description

Running a Python script with SlicerPython on macOS, I run into this error:

Traceback (most recent call last):
File "HelloWorld.py", line 1, in <module>
import vtk
File "/Applications/Slicer.app/Contents/bin/Python/vtk.py", line 12, in <module>
all_m = importlib.import_module('vtkmodules.all')
File "/Applications/Slicer.app/Contents/lib/Python/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/Applications/Slicer.app/Contents/bin/Python/vtkmodules/all.py", line 34, in <module>
from .vtkRenderingQt import
File "/Applications/Slicer.app/Contents/bin/Python/vtkmodules/vtkRenderingQt.py", line 9, in <module>
from vtkRenderingQtPython import

ImportError: dlopen(/Applications/Slicer.app/Contents/lib/Slicer-4.9/vtkRenderingQtPython.so, 2): Library not loaded: @rpath/Frameworks/QtWidgets.framework/Versions/5/QtWidgets
Referenced from: /Applications/Slicer.app/Contents/lib/Slicer-4.9/libvtkRenderingQt-9.0.1.dylib
Reason: image not found

This can be fixed by first applying the fix in https://issues.slicer.org/view.php?id=4553 and then running the following:

install_name_tool -add_rpath "@executable_path/.." /Applications/Slicer.app/Contents/bin/python-real

Perhaps this step should be added to the packaging process on macOS.