comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL-python bridge issue for MacOS Sierra 10.12.2 (Library not loaded: libpython2.7.dylib)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDL-python bridge issue for MacOS Sierra 10.12.2 (Library not loaded: libpython2.7.dylib) [message #94458] Sun, 28 May 2017 16:19 Go to previous message
tianhuachengyue is currently offline  tianhuachengyue
Messages: 7
Registered: November 2015
Junior Member
Hi guys,

I installed IDL 8.5.1 successfully on my MacOS Sierra 10.12.2 following the instructions from

http://www.harrisgeospatial.com/Support/Forums/tabid/2342/af t/4715/Default.aspx

However, when I tried to set up the IDL-python bridge, I run into an issue (I'm using python 2.7, the preinstalled version on my mac, not Anaconda). When I ran:

np = Python.Import('numpy')

I got the error message:

% DLM_LOAD: Error loading sharable executable.
Symbol: IDL_Load, File = /Applications/exelis/idl85/bin/bin.darwin.x86_64/idl_python2 7.so
dlopen(/Applications/exelis/idl85/bin/bin.darwin.x86_64/idl_ python27.so, 1): Library not loaded: libpython2.7.dylib
Referenced from: /Applications/exelis/idl85/bin/bin.darwin.x86_64/idl_python2 7.so
Reason: image not found


I searched the web and followed one post by Chris Torrence ( http://stackoverflow.com/questions/38468764/idl-python-bridg e-fails-due-to-sip-on-osx-el-capitan) to set up the path, but still got the same error. Here are the steps I did on my mac:

===================
First, set up the paths:
export PATH /System/Library/Frameworks/Python.framework/Versions/2.7/bin :${PATH}
export PYTHONHOME /System/Library/Frameworks/Python.framework/Versions/2.7
export PYTHONPATH /Users/username/Applications/exelis/idl/bin/bin.darwin.x86_6 4
export PYTHONPATH ${PYTHONPATH}:/Users/username/Applications/exelis/idl85/lib/ bridges

Then, for the IDL-to-Python bridge, run the following commands:
cd Applications/exelis/idl85/bin/bin.darwin.x86_64/
sudo install_name_tool -change libpython2.7.dylib /System/Library/Frameworks/Python.framework/Versions/Current /lib/libpython2.7.dylib pythonidl27.so

For the Python-to-IDL bridge (some of these are duplicated from above):

cd Applications/exelis/idl85/bin/bin.darwin.x86_64/

sudo install_name_tool -change libidl.8.5.dylib @loader_path/libidl.8.5.dylib pythonidl27.so
sudo install_name_tool -change libidl_ips.8.5.dylib @loader_path/libidl_ips.8.5.dylib pythonidl27.so

sudo install_name_tool -change libpython2.7.dylib /System/Library/Frameworks/Python.framework/Versions/Current /lib/libpython2.7.dylib pythonidl27.so


At this point, DYLD_LIBRARY_PATH is still needed in the .login to specify IDL’s bin directory. To eliminate that, the following updates can be made to tell various libraries where to find their dependencies:

sudo install_name_tool -change libMesaGL6_2.dylib @loader_path/libMesaGL6_2.dylib libidl.8.5.dylib
sudo install_name_tool -change libMesaGLU6_2.dylib @loader_path/libMesaGLU6_2.dylib libidl.8.5.dylib
sudo install_name_tool -change libOSMesa6_2.dylib @loader_path/libOSMesa6_2.dylib libidl.8.5.dylib
sudo install_name_tool -change libXm.3.0.2.dylib @loader_path/libXm.3.0.2.dylib libidl.8.5.dylib
sudo install_name_tool -change libMesaGL6_2.dylib @loader_path/libMesaGL6_2.dylib libMesaGLU6_2.dylib
sudo install_name_tool -change libMesaGL6_2.dylib @loader_path/libMesaGL6_2.dylib libOSMesa6_2.dylib
sudo install_name_tool -change libidl.8.5.dylib @loader_path/libidl.8.5.dylib libidl_ips.8.5.dylib
===================

After these settings, when I try to import python modules in IDL, the error message says Library not loaded: libpython2.7.dylib... Can anyone help me on this?

Cheers,
Huazeng
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Function graphics and Widget_Window
Next Topic: turn a string value into variable name

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 09:19:37 PDT 2025

Total time taken to generate the page: 0.00418 seconds