Sto eseguendo uno script Python con la versione MacPorts di Python (2.7), cioè, ho eseguito:
port select --set python python27
Tuttavia, quando eseguo il mio script, non riesce a trovare un dylib in /opt/local/lib
:
ImportError: dlopen(/opt/local/lib/python2.7/site-packages/grgsm/_grgsm_swig.so, 2): Library not loaded: libgnuradio-grgsm.dylib
Referenced from: /opt/local/lib/python2.7/site-packages/grgsm/_grgsm_swig.so
Reason: image not found
Il dylib in questione si trova qui:
-rwxr-xr-x 1 root admin 816036 Dec 16 11:24 /opt/local/lib/libgnuradio-grgsm.dylib
L'impostazione export DYLIB_LIBRARY_PATH=/opt/local/lib/
non aiuta in questo caso (né dovrebbe essere realmente necessario per ogni utente sul sistema impostare tale variabile d'ambiente). Ho già eseguito update_dyld_shared_cache
.
Il modulo Python in questione risiede in /opt/local/lib/python2.7/site-packages
quindi ho creato un link simbolico ad esso in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
.
otool -L
sui rapporti .so
caricati:
otool -L /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/grgsm/_grgsm_swig.so
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/grgsm/_grgsm_swig.so:
libgnuradio-grgsm.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/local/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/local/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/opt/local/lib/libgnuradio-runtime.3.7.8.1.dylib (compatibility version 3.7.8, current version 0.0.0)
/opt/local/lib/libgnuradio-pmt.3.7.8.1.dylib (compatibility version 3.7.8, current version 0.0.0)
/opt/local/lib/libvolk.1.1.1.dylib (compatibility version 1.1.1, current version 0.0.0)
/usr/local/lib/libosmocore.7.dylib (compatibility version 8.0.0, current version 8.0.0)
/usr/local/lib/libosmogsm.5.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)
Si noti che la libreria in questione non ha un percorso.