Error running on OS X 10.11 - Reason: unsafe use of @executable_path
Any ideas how to deal with this error? I had to disable Apple's System Integrity Protection to get around it for now.
ERROR grails.app.services.com.affectiva.platform.dashboardAutomation.ProjectValidationService - Traceback (most recent call last):
File "/usr/local/bin/parse_sav", line 9, in <module>
load_entry_point('spsstools==1.0.dev0', 'console_scripts', 'parse_sav')()
File "build/bdist.macosx-10.11-x86_64/egg/spsstools/bin/__init__.py", line 15, in parse_sav
File "build/bdist.macosx-10.11-x86_64/egg/spsstools/bin/spssio.py", line 25, in parse_sav
File "build/bdist.macosx-10.11-x86_64/egg/spsstools/savparser.py", line 46, in __init__
File "/usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/savReader.py", line 81, in __init__
ioUtf8, ioLocale)
File "/usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/header.py", line 31, in __init__
super(Header, self).__init__(savFileName, ioUtf8, ioLocale)
File "/usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/generic.py", line 29, in __init__
self.spssio = self.loadLibrary()
File "/usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/generic.py", line 117, in loadLibrary
spssio = self._loadLibs("macos")
File "/usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/generic.py", line 89, in _loadLibs
return [load(os.path.join(path, lib)) for lib in libs][-1]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/spssio/macos/libicuuc48.1.dylib, 6): Library not loaded: @executable_path/../lib/libicudata48.1.dylib
Referenced from: /usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/spssio/macos/libicuuc48.1.dylib
Reason: unsafe use of @executable_path in /usr/local/lib/python2.7/site-packages/savReaderWriter-3.4.2-py2.7.egg/savReaderWriter/spssio/macos/libicuuc48.1.dylib with restricted binary
Comments (3)
-
repo owner -
Hi All,
I have the same problem right now.
I followed the installation steps in the Docs, then I tried to run the testing python script, when I received the following error, which is pretty much the same as Jay.
OSError: dlopen(/Library/Python/2.7/site-packages/savReaderWriter/spssio/macos/libicuuc48.1.dylib, 6): Library not loaded: @executable_path/../lib/libicudata48.1.dylib Referenced from: /Library/Python/2.7/site-packages/savReaderWriter/spssio/macos/libicuuc48.1.dylib Reason: unsafe use of @executable_path in /Library/Python/2.7/site-packages/savReaderWriter/spssio/macos/libicuuc48.1.dylib with restricted binary
Any ideas how to get over this in Mac OS ?!!
-
reporter The way I worked around it was to disable the Apple's System Integrity Protection.
csrutil disable
- Log in to comment
Hi Jay,
You could try setting DYLD_FALLBACK_LIBRARY_PATH or DYLD_LIBRARY_PATH to the folder where the SPSS I/O libraries for macos live. But see here for some warnings: http://stackoverflow.com/questions/3146274/is-it-ok-to-use-dyld-library-path-on-mac-os-x-and-whats-the-dynamic-library-s
I believe the "official" way to deal with this on Mac OS is to use the tool 'install_name_tool' (Linux equivalent: patchelf). However I don't know anything about that. I'd be grateful if you would send me a short how-to if you follow this route, so I can update the docs on Pypi.
Btw, sometimes LC_LANG and LC_ALL are not set correctly on Mac. You might want to check this because it could cause errors with the SPSS locale, which is initialized using the host locale.
Best wishes, Albert-Jan