Python bridge with MacPorts python 2.7? [message #91889] |
Tue, 08 September 2015 17:56  |
dg86
Messages: 118 Registered: September 2012
|
Senior Member |
|
|
Dear Folks,
Before taking the time to figure this out for myself, I was wondering if
anyone had the IDL-Python bridge working with a MacPorts install
of python. Specifically, what are the right environment variables for
such a system?
The MacPorts version of python is the first one to be called with my
PATH. So I tried out the bridge without any new environment variables
and obtained
IDL> Python.Import('numpy.random')
% Loaded DLM: PYTHON27.
ImportError: numpy.core.multiarray failed to import
% PYTHON_IMPORT: Exception: cannot import name multiarray.
Then I tried setting the following in my .profile:
export PYTHONHOME="/opt/local/Library/Frameworks/Python.framework/Version/2.7 "
export PYTHONPATH=" /Applications/exelis/idl/bin/bin.darwin.x86_64:/Applications /
exelis/idl/lib/bridges"
This yielded
IDL> Python.Import('numpy.random')
% Loaded DLM: PYTHON27.
ImportError: No module named site
and dumped my back to the shell, rather than the IDL prompt.
This made me realize that I might save quite a bit of time by seeking
advice from someone who's already made it work.
Funnily enough, Slither just worked for me out of the box.
Many thanks,
David
|
|
|