Page 1 of 1

Kernel dies in Jupyter notebook when attempting to import NEURON

Posted: Mon Mar 15, 2021 5:57 pm
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.

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

Posted: Tue Mar 16, 2021 12:17 am
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?

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

Posted: Tue Mar 16, 2021 7:35 pm
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.

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

Posted: Thu Mar 18, 2021 12:06 pm
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.