IPython import segmentation fault...

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

Moderator: hines

Post Reply
gartland

IPython import segmentation fault...

Post by gartland » Thu Jul 03, 2008 4:52 pm

I have the latest code from the NEURON subversion repository built and installed. I have built neuron with both --with-numpy and --enable-numpy, but it doesn't seem to matter, either way I get the same error *only* when I try to import neuron from within IPython. at the python prompt it seems to work fine. Here is what my terminal looks like:

Code: Select all

gartland@komodo:~$ ipython
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) 
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]: import neuron
NEURON -- VERSION 6.2.1036 (2163) 2008-07-02
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2007
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 38
NEURON: PyRun_SimpleString("import sys") == 0
 near line 0
 objref hoc_obj_[2]
                   ^
Segmentation fault
gartland@komodo:~$ nrniv -python
NEURON -- VERSION 6.2.1036 (2163) 2008-07-02
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2007
See http://www.neuron.yale.edu/credits.html

>>> import neuron
>>> 
gartland@komodo:~$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import neuron
NEURON -- VERSION 6.2.1036 (2163) 2008-07-02
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2007
See http://www.neuron.yale.edu/credits.html

>>> import sys
>>> sys.version
'2.5.2 (r252:60911, Apr 21 2008, 11:12:42) \n[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]'
Is this possibly a problem with the PyRun_SimpleString() in IPython? I don't know, but I just fixed it by commenting out that whole 'if' block. I'm not sure why the function useful since for me the path "neuronhome/lib/python" ("/home/gartland/neuron/nrn/lib/python") doesn't exist.

Anyway I just thought you should be aware.

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

Re: IPython import segmentation fault...

Post by hines » Fri Jul 25, 2008 9:09 am

I don't see that problem.
("/home/gartland/neuron/nrn/lib/python") doesn't exist.
but this seems strange to me. Where did you install (--prefix=...)?

Post Reply