Can't import scipy when using nrngui -python

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
bhalterm
Posts: 52
Joined: Wed Mar 08, 2006 10:43 am
Location: University of Pennsylvania

Can't import scipy when using nrngui -python

Post by bhalterm » Wed Nov 02, 2011 4:28 pm

I'm trying to use Enthought's python distribution to have scipy accessible when using NEURON. I am compiling NEURON from the latest source checked out with mercurial. When I use the command

Code: Select all

nrngui -python
I can import numpy, but not scipy (it says the module does not exist). When using just python, I am able to import scipy.
Also, what is the --with-numpy configure flag? I didn't use that.

Thanks!

P.S. This is in osx lion.

bhalterm
Posts: 52
Joined: Wed Mar 08, 2006 10:43 am
Location: University of Pennsylvania

Re: Can't import scipy when using nrngui -python

Post by bhalterm » Thu Nov 03, 2011 12:24 am

Ok... It looks like NEURON is using the preinstalled python instead of the enthought python distribution. I am compiling with

Code: Select all

./configure --prefix=$IDIR/nrn --with-iv=$IDIR/iv --with-nrnpython PYLIB='-framework Python' PYLIBLINK='-framework Python' --build=x86_64-apple-darwin11.2.0 --with-paranrn
Should '-framework Python' still work to find the enthought distribution?

hines
Site Admin
Posts: 1580
Joined: Wed May 18, 2005 3:32 pm

Re: Can't import scipy when using nrngui -python

Post by hines » Thu Nov 03, 2011 4:45 pm

From a terminal, how do you launch the Enthought version of Python? If you are lucky, all you would need is
--with-nrnpython=/where/you/find/python
If you are unlucky you need to specify four variables analogous to:
PYINCDIR="$BG_BASE/gnu-linux/include/python2.6"
PYLIB="-L$BG_BASE/gnu-linux/lib -lpython2.6"
PYLIBDIR="$BG_BASE/gnu-linux/lib"
PYLIBLINK="-L$BG_BASE/gnu-linux/lib -lpython2.6"

bhalterm
Posts: 52
Joined: Wed Mar 08, 2006 10:43 am
Location: University of Pennsylvania

Re: Can't import scipy when using nrngui -python

Post by bhalterm » Thu Nov 03, 2011 9:11 pm

Thanks!!! The following works:

Code: Select all

./configure --prefix=$IDIR/nrn --with-iv=$IDIR/iv --with-nrnpython=$ENTHOUGHT_HOME/bin/python PYLIB="-L$ENTHOUGHT_HOME/lib -lpython2.7" PYLIBLINK="-L$ENTHOUGHT_HOME/lib -lpython2.7" PYINCDIR="$ENTHOUGHT_HOME/include/python2.7" PYLIBDIR="$ENTHOUGHT_HOME/lib" --build=x86_64-apple-darwin11.2.0 --with-paranrn
Where $ENTHOUGHT_HOME is

Code: Select all

/Library/Frameworks/EPD64.framework/Versions/Current

Post Reply