Tutorial for using pyradiomics, no module named _collections

Actually, I think I see the problem. Slicer python has DYLD_LIBRARY_PATH set by the launcher:

>>> os.environ["DYLD_LIBRARY_PATH"]
'/opt/worksw/Slicer-4.8.1.app/Contents/Extensions-26813/SlicerRadiomics/bin:/opt/worksw/Slicer-4.8.1.app/Contents/Extensions-26813/SlicerRadiomics/lib/Slicer-4.8:/opt/worksw/Slicer-4.8.1.app/Contents/Extensions-26813/SlicerRadiomics/lib/Slicer-4.8/cli-modules:/opt/worksw/Slicer-4.8.1.app/Contents/Extensions-26813/SlicerRadiomics/lib/Slicer-4.8:/opt/worksw/Slicer-4.8.1.app/Contents/bin:/opt/worksw/Slicer-4.8.1.app/Contents/lib/Slicer-4.8:/opt/worksw/Slicer-4.8.1.app/Contents/lib/Slicer-4.8/cli-modules:/opt/worksw/Slicer-4.8.1.app/Contents/lib/Slicer-4.8/qt-loadable-modules:../lib/Slicer-4.8/qt-loadable-modules:/opt/worksw/Slicer-4.8.1.app/Contents/lib/TclTk/lib:/opt/worksw/Slicer-4.8.1.app/Contents/lib/Python/lib:/opt/worksw/Slicer-4.8.1.app/Contents/lib/Python/lib/python2.7/site-packages/numpy/core:/opt/worksw/Slicer-4.8.1.app/Contents/lib/Python/lib/python2.7/site-packages/numpy/lib:/opt/worksw/Slicer-4.8.1.app/Contents/lib/TclTk/lib/itcl4.0.1'

But the wrapper script subshell does not inherit this setting because of Apple SIP policy. Adding echo "DYLD: $DYLD_LIBRARY_PATH" in cli-modules/SlicerRadiomicsCLI gives an empty result (DYLD:).

1 Like