These instructions are for UNIX/Linux, and may also work for Mac OS X. For Windows, you could try adapting the instructions given here, but there is a good chance it will not work at the moment.
Download and install Interviews following the instructions on the NEURON website.
Get the NEURON sources using Subversion, as follows:
$ cd /where/to/install/neuron $ svn checkout https://neuralensemble.kip.uni-heidelberg.de/svn/nrnpy/branches/pygetsetcall nrnpy
Then build and install as follows:
$ cd nrnpy $ ./build.sh $ ./configure --prefix=`pwd` --with-iv=/where/you/installed/interviews --with-nrnpython $ make $ make install
Now add the bin directory to your PATH, e.g. in the bash shell on an i686 processor:
$ export PATH=/where/to/install/neuron/nrnpy/i686/bin:$PATH
Replace i686 with your own CPU architecture if necessary.
You should now be able to run NEURON with Python as the interpreter:
$ nrniv -python NEURON -- VERSION 6.0.pygetsetcall.23 (35) 2007-05-23 by John W. Moore, Michael Hines, and Ted Carnevale Duke and Yale University -- Copyright 1984-2007 >>>
If you would like to be able to import NEURON as a module in python,
$ cd src/nrnpython $ python setup.py install
This will install a file hoc.so in your site-packages directory. You will most likely need root privileges to do this.
If you would like to install hoc.so somewhere else, follow the instructions given by
$ python setup.py --help install
For example the command:
$ python setup.py install --prefix=$HOME/opt/nrnpy
installs the modules under $HOME/opt/nrnpy/lib/pythonX.X/site-packages, where pythonX.X is your python version such as python2.4, for example. If you have another python version, such as python2.5, replace python2.4 with python2.5 accordingly below.
Make sure you add the site-packages directory where you install it (for example: $HOME/opt/nrnpy/lib/python2.4/site-packages) to the PYTHONPATH environment variable.
For bash:
$ export PYTHONPATH=$PYTHONPATH:$HOME/opt/nrnpy/lib/python2.4/site-packages
In python:
>>> import sys,os >>> sys.path+=[os.environ['HOME']+'opt/nrnpy/lib/python2.4/site-packages']
You should now be able to do:
>>> import neuron NEURON -- VERSION 6.0.pygetsetcall.23 (35) 2007-05-23 by John W. Moore, Michael Hines, and Ted Carnevale Duke and Yale University -- Copyright 1984-2007 >>>
