NEURON simulation environment

From their website:

The NEURON simulation environment is used in laboratories and classrooms around the world for building and using computational models of neurons and networks of neurons.

In order to work with it on CoCalc, you need to add a bit of setup code.

Jupyter Notebook

To use NEURON in a Jupyter Notebooks, we have to delete the $DISPLAY variable and add it to the PYTHONPATH:

import os
if 'DISPLAY' in os.environ:
    del os.environ['DISPLAY']
import sys
sys.path.insert(0, '/usr/local/nrn/lib/python/')

Only then import h:

from neuron import h, __version__

If it doesn’t work, restart the kernel and run the first cell again and then import h. If there is still a problem, please contact us.

Example worksheet: neron-yale.ipynb.

NEURON in a jupyter notebook

Graphical Application

CoCalc supports graphical applications, but there are limits to how it works with NEURON. Open up X11 file to start such a virtual desktop environment, and then run nrngui.