Kernel dies in Jupyter notebook when attempting to import NEURON

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

Moderator: hines

Post Reply
oitani
Posts: 2
Joined: Fri Feb 21, 2020 7:11 am

Kernel dies in Jupyter notebook when attempting to import NEURON

Post by oitani »

Description:
When attempting to import h or gui from the neuron module in a Jupyter Notebook, the Jupyter kernel dies.

Code that raises error:

Code: Select all

from neuron import h
from neuron import h, gui
Error message returned by Jupyter:
Kernel Restarting
The kernel for CWD/notebook.ipynb appears to have died. It will restart automatically.
Potential Causes:
  • NEURON Installation related: to rule out, check that NEURON is properly installed and can be accessed by the python environment you’re using. Test this in a directory that does not have any mod/compiled mod files in it.
  • Python exit related: certain errors raised by NEURON may lead to exiting python. To get a more informative error message, try importing neuron in a python/ipython terminal in the same working directory.
I haven't run across a thread that addresses this error so I thought to make one in case others are facing the same issue.
In my case, the source of the error was a naming conflict between mod files, where they shared the same user defined name.
ted
Site Admin
Posts: 5918
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Kernel dies in Jupyter notebook when attempting to import NEURON

Post by ted »

In my case, the source of the error was a naming conflict between mod files, where they shared the same user defined name.
Do you mean to say that the mod files had the same name? Or that their NEURON blocks contained identical
SUFFIX
or
POINT_PROCESS
or
ARTIFICIAL_CELL
statements?
oitani
Posts: 2
Joined: Fri Feb 21, 2020 7:11 am

Re: Kernel dies in Jupyter notebook when attempting to import NEURON

Post by oitani »

The mod files themselves had different names but shared the same SUFFIX.
NEURON gave the appropriate error message when I tried to import NEURON in python from the command line.
ted
Site Admin
Posts: 5918
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Kernel dies in Jupyter notebook when attempting to import NEURON

Post by ted »

Thanks for that information.

I would also expect that nrnivmodl (or mknrndll) would generate an error message if it encountered duplicate SUFFIXes when compiling mod files.
Post Reply