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

Home » Public Forums » archive » Python bridge with MacPorts python 2.7?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Python bridge with MacPorts python 2.7? [message #91889] Tue, 08 September 2015 17:56 Go to next message
dg86 is currently offline  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 Go to previous message
chris_torrence@NOSPAM is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to obtain covariance for unequal samples in IDL?
Next Topic: Invert Matrix, MATLAB vs IDL

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

Current Time: Wed Oct 08 07:24:15 PDT 2025

Total time taken to generate the page: 0.00514 seconds