Page 1 of 1

Ipython can't import latest version?!

Posted: Tue Dec 15, 2009 7:35 pm
by gartland
Today I recompiled NEURON from the mercurial repository and it seemed to go fine (I only do this every six months so I can't always remember exactly how I did it last time...)
My models work when I run them using plain old python (Actually they work better because you fixed a bug with LONGITUDINAL DIFFUSION, thanks!)
But when I try to run the models in an interactive ipython session I get a Segmentation fault. I used to use ipython without problems. Am I doing something wrong? I'll go track down line 42 in nrnpython.cpp but something tells me the problem is something I've messed up in compiling. Is there something I could have messed up?

Thanks for the help,

-Andrew


Importing neuron works in python

Code: Select all

gartland@komodo:~$ python
Python 2.5.2 (r252:60911, Jul 22 2009, 15:35:03)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from neuron import h
NEURON -- VERSION 7.2 (375:9a5ae43de640) 2009-12-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

>>>
But not with ipython

Code: Select all

gartland@komodo:~$ ipython
Python 2.5.2 (r252:60911, Jul 22 2009, 15:35:03)
Type "copyright", "credits" or "license" for more information.

IPython 0.8.1 -- An enhanced Interactive Python.
?       -> Introduction to IPython's features.
%magic  -> Information about IPython's 'magic' % functions.
help    -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.

In [1]: from neuron import h
NEURON -- VERSION 7.2 (375:9a5ae43de640) 2009-12-09
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

---------------------------------------------------------------------------
<type 'exceptions.ImportError'>           Traceback (most recent call last)

/home/gartland/<string> in <module>()

<type 'exceptions.ImportError'>: __import__ not found
Assertion failed: file nrnpython.cpp, line 42
NEURON: PyRun_SimpleString("import sys") == 0
 near line 0
 objref hoc_obj_[2]
                   ^
Segmentation fault

Re: Ipython can't import latest version?!

Posted: Wed Dec 16, 2009 8:07 am
by hines
I don't experience that problem. (however my ipython version is 0.8.4 ).
I just looked and the current stable version is 0.10 . If you have problems
with that I'll install it and see if I can reproduce them.
On my machine I use
$ echo $PYTHONPATH
/home/hines/lib/python
and use the final install step of
cd <objectbuilddir>/src/nrnpython
python setup.py install --home
But before that final install step, it might be a good idea to remove the previously
installed neuron module and egg in PYTHONPATH.

My configure for NEURON is
../nrn/configure '--prefix=/home/hines/neuron/nrnmpi' '--srcdir=../nrn' '--with-paranrn' '--with-nrnpython'

Re: Ipython can't import latest version?!

Posted: Thu Dec 17, 2009 1:43 pm
by gartland
You were right. An upgrade to IPython 0.10 did the trick. In Ubuntu that just meant typing

Code: Select all

easy_install --upgrade ipython
Thanks