[IPython-User] IPython Notebook fails to run a line of code the runs fine in IPython

coderforlife jeff@coderforlife....
Fri Sep 13 23:41:18 CDT 2013


Hi,

I am trying to use NEURON from IPython Notebook. NEURON is a C library with
a Python wrapper. The following is how I import it:

    from neuron import h  # or import neuron

In regular Python and IPython it works fine, I get the expected message
saying:

    NEURON -- VERSION 7.2 (524:1a4443872b11) 2011-06-14
    Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
    See http://www.neuron.yale.edu/credits.html

In IPython Notebook - even if done from c.IPKernelApp.exec_lines or
c.IPKernelApp.code_to_run in ipython_notebook_config.py - I get the
following:

    NEURON -- VERSION 7.2 (524:1a4443872b11) 2011-06-14
    Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
    See http://www.neuron.yale.edu/credits.html

    Assertion failed: file nrnpython.cpp, line 45
    NEURON: PyRun_SimpleString("import sys") == 0
     near line 0
     objref hoc_obj_[2]
                       ^
    NEURON exiting abnormally, press return to quit

Now I know that none of you will likely know anything about the NEURON
internals, but that error tells me "import sys" is not working. If I do
"import sys" from notebook it works fine.  What could be different about the
IPython Notebook environment that causes "import sys" to fail from C?

I am running Python(x,y) [32-bit] on Windows 7 SP1 [64-bit], relevant
version numbers:
    Python v2.7.5
    IPython v0.13.2

Jeff


Attached is the nrnpython.cpp file.

nrnpython.cpp <http://python.6.x6.nabble.com/file/n5032177/nrnpython.cpp>  



--
View this message in context: http://python.6.x6.nabble.com/IPython-Notebook-fails-to-run-a-line-of-code-the-runs-fine-in-IPython-tp5032177.html
Sent from the IPython - User mailing list archive at Nabble.com.


More information about the IPython-User mailing list