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
Potential Causes:Kernel Restarting
The kernel for CWD/notebook.ipynb appears to have died. It will restart automatically.
- 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.
In my case, the source of the error was a naming conflict between mod files, where they shared the same user defined name.