Installing NEURON with python and Neuronvisio

Since it took some time, I’m going to describe the steps I took to install NEURON with support for python and the 3D visualization tool neuronvisio. I’m running Ubuntu 14.04, python 2.7.

First, I installed the neuron python package found at Note that this installs NEURON 7.1, which is not the latest version. I had to install also libreadline-dev to get nrnivmodl (the hoc compiler) working:

sudo apt-get install libreadline-dev

Then install the prerequisites for neuronvisio:

sudo apt-get install python-qt4 python-matplotlib python-setuptools python-tables mayavi2 python-pip

Install neuronvisio

cd ~/python/
git clone git://
python install

Add ~/python to your $PYTHONPATH, add ~/python/neuronvisio/bin/neuronvisio (or links thereto) to path The final change (the most strange, and the that’s making me write this down) is as follows. Following steps 1-5 should get NEURON and neuronvisio working in python. I could run simulations, plot the 3D structures, etc. The one thing I was unable to do was to select segments in the 3D visualization window. I would receive the error:

Pick() takes exactly 4 arguments (2 given)

The workaround I found was to edit the following file in mayavi:

sudo vim /usr/lib/python2.7/dist-packages/mayavi/core/

So that the line changes from and to: - 168: picker.pick((x, y, 0), self.scene.scene.renderer) + 168: picker.pick(x, y, 0, self.scene.scene.renderer)

It’s annoying that such a strange workaround was necessary. However, a similar fix was suggested here (, so perhaps I wasn’t alone.