Re: IDL-python bridge issue for MacOS Sierra 10.12.2 (Library not loaded: libpython2.7.dylib) [message #94469 is a reply to message #94467] |
Thu, 01 June 2017 03:25  |
tianhuachengyue
Messages: 7 Registered: November 2015
|
Junior Member |
|
|
On Wednesday, May 31, 2017 at 7:22:02 PM UTC-7, Chris Torrence wrote:
> On Sunday, May 28, 2017 at 5:19:11 PM UTC-6, huazeng wrote:
>> 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
>
> I don't think the IDL Python bridge is going to work with the stock Python that comes on the Mac. It's either missing a bunch of libraries or they're too old. You're better off installing a version of Anaconda, preferably containing Python 3.5.
>
> Cheers,
> Chris
Thanks very much for your advice Chris! I'll install Anaconda and see if it works.
Cheers,
Huazeng
|
|
|