Switching Python Shells in OSX

48 views
Skip to first unread message

Jon C

unread,
Mar 30, 2010, 4:58:20 PM3/30/10
to stimfit
I have just started with stimfit, and it looks very promising. Thank
you for writing and maintaining this.

I have two pythons on my OSX (10.6) machine: apple-python and an
Enthought distribution, the latter of which has matplotlib/scipy etc.
installed. Stimfit is currently using apple-python; is there a way to
change it such that the Enthought distribution is used instead?

Jon

csh

unread,
Mar 31, 2010, 5:01:00 AM3/31/10
to stimfit
Hi Jon,

On Mar 30, 9:58 pm, Jon C <toeho...@gmail.com> wrote:
> I have two pythons on my OSX (10.6) machine: apple-python and an
> Enthought distribution, the latter of which has matplotlib/scipy etc.
> installed.  Stimfit is currently using apple-python; is there a way to
> change it such that the Enthought distribution is used instead?

Good question. As a workaround, can you import your Enthought modules
into Apple Python by appending your Enthought path to sys.path?
Something along these lines:

import sys
sys.path.append('/Wherever/your/Enthought/modules/are')
import scipy

I'll try to find out whether there's an easy way to switch Python
distributions, but I'm afraid that you might have to build stimfit
from source using your Enthought Python.

Best
Christoph

csh

unread,
Mar 31, 2010, 6:18:37 AM3/31/10
to stimfit
On Mar 30, 9:58 pm, Jon C <toeho...@gmail.com> wrote:
> I have two pythons on my OSX (10.6) machine: apple-python and an
> Enthought distribution, the latter of which has matplotlib/scipy etc.
> installed.  Stimfit is currently using apple-python; is there a way to
> change it such that the Enthought distribution is used instead?

Here's yet another option: In a terminal, change to the directory
where stimfit.app is located. Then, you might be able to change the
Python library using:

install_name_tool -change /System/Library/Frameworks/Python.framework/
Versions/2.5/Python /Where/Your/Enthought/Python2.5/Framework/is/
located stimfit.app/Contents/MacOS/stimfit

(all in one line). Let me know if this works.

Christoph

Jon C

unread,
Apr 5, 2010, 5:27:09 PM4/5/10
to stimfit
Thanks for the quick and helpful reply.

Solution 1 (sys.path.append) was a no go (at least in my hands).
After adding the path from Enthought python site packages/bin and
called import pylab, stimfit python reports "ImportError: cannot
import name ccompiler

Christoph Schmidt-Hieber

unread,
Apr 6, 2010, 9:07:16 AM4/6/10
to sti...@googlegroups.com
On Mon, Apr 5, 2010 at 10:27 PM, Jon C <toeh...@gmail.com> wrote:
> Solution 1 (sys.path.append) was a no go (at least in my hands).
> After adding the path from Enthought python site packages/bin and
> called import pylab, stimfit python reports "ImportError: cannot
> import name ccompiler

Thanks for testing.
Did solution 2 work for you?

Christoph

Jon C

unread,
Apr 7, 2010, 3:46:40 AM4/7/10
to stimfit
Hi Christoph,

This is weird. My previous message got truncated. My apologies.

Command line took solution 2 just fine, but stimfit does not seem to
be affected by it. Stimfit reads the same version of python, and
reports the same ImportError: No module named pylab.

I'm trying out what stimfit can (that pClamp->python on ATF can't).
ATM it's as much about clearing my head about what I want to do with
the data. When/if I'm convinced about stimfit, and integration with
matplotlib is critical, I'll try to build it from source - it looks
abit daunting to do without a good reason ;)

Jon

Reply all
Reply to author
Forward
0 new messages