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
|
|
|
Re: Python bridge with MacPorts python 2.7? [message #91898 is a reply to message #91889] |
Wed, 09 September 2015 08:34  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Tuesday, September 8, 2015 at 6:56:32 PM UTC-6, David Grier wrote:
> 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
Hi David,
I can't give you much help with MacPorts, but perhaps someone else has some experience.
Regarding Slither, I think they hardcoded their builds to very specific versions of Python. I just tried their "3.3" build with Python 3.4, and it no longer works.
You might try the Anaconda installation of Python, to see if you have better luck. That's the one that we tested against on the Mac, and it seemed to work fine once you set enough environment variables.
Hope this helps!
-Chris
|
|
|