============ Installation ============ The following instructions are for Linux and Mac OS X. It should be possible to install and run PyNN on Windows, but this has not been tested. Installing PyNN requires: * Python (version 2.6, 2.7, 3.3 or 3.4) * a recent version of the NumPy_ package * the lazyarray_ package * the Neo_ package * at least one of the supported simulators: e.g. NEURON, NEST, or Brian. Optional dependencies are: * mpi4py_ (if you wish to run distributed simulations using MPI) * either Jinja2_ or Cheetah_ (templating engines) * the CSA_ library Installing PyNN =============== .. note:: if using NEURON, it is easiest if you install NEURON *before* you install PyNN (see below). The easiest way to get PyNN is to use pip_:: $ pip install pyNN If you are running Debian or Ubuntu, there are :doc:`binary packages ` available. If you would prefer to install manually, :doc:`download the latest source distribution `, then run the setup script, e.g.:: $ tar xzf PyNN-0.8.0rc1.tar.gz $ cd PyNN-0.8.0rc1 $ python setup.py install This will install it to your Python :file:`site-packages` directory, and may require root privileges. We strongly recommend, however, that you use a virtualenv_ or a Conda_ environment. We assume you have already installed the simulator(s) you wish to use it with. If this is not the case, see below for installation instructions. Test it using something like the following:: >>> import pyNN.nest as sim >>> sim.setup() >>> sim.end() (This assumes you have NEST installed). With NEURON as the simulator, make sure you install NEURON *before* you install PyNN. The PyNN installation will then compile PyNN-specific membrane mechanisms, which are loaded when importing the :mod:`neuron` module:: >>> import pyNN.neuron as sim NEURON -- Release 7.1 (359:7f113b76a94b) 2009-10-26 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008 See http://www.neuron.yale.edu/credits.html loading membrane mechanisms from /home/andrew/dev/pyNN/neuron/nmodl/i686/.libs/libnrnmech.so Additional mechanisms from files adexp.mod alphaisyn.mod alphasyn.mod expisyn.mod gsfa_grr.mod hh_traub.mod izikevich.mod netstim2.mod refrac.mod reset.mod stdwa_guetig.mod stdwa_softlimits.mod stdwa_songabbott.mod stdwa_symm.mod tmgsyn.mod tmisyn.mod tsodyksmarkram.mod vecstim.mod If you installed PyNN before installing NEURON, or if you update your PyNN installation, you will need to manually run :command:`nrnivmodl` in the :file:`pyNN/neuron/nmodl` directory. Installing NEURON ================= Download the sources for the latest release of NEURON, in ``.tar.gz`` format, from ``_. Also download Interviews from the same location. Compile Interviews and NEURON according to the instructions given at ``_, except that when you run :command:`configure`, add the options :option:`--with-nrnpython` and, optionally, :option:`--with-paranrn`, i.e.:: $ ./configure --prefix=`pwd` --with-nrnpython --with-paranrn $ make $ make install Make sure that you add the Interviews and NEURON :file:`bin` directories to your path. Test that the Python support has been enabled by running:: $ nrniv -python NEURON -- VERSION 7.3 ansi (1078:2b0c984183df) 2014-04-04 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2014 See http://www.neuron.yale.edu/neuron/credits >>> import hoc >>> import nrn Now you can compile and install NEURON as a Python package:: $ cd src/nrnpython $ python setup.py install Now test everything worked:: $ python >>> import neuron NEURON -- VERSION 7.3 ansi (1078:2b0c984183df) 2014-04-04 Duke, Yale, and the BlueBrain Project -- Copyright 1984-2014 See http://www.neuron.yale.edu/neuron/credits If you run into problems, check out the `NEURON Forum`_. Installing NEST and PyNEST ========================== NEST 2.6 can be downloaded from ``_. Earlier versions of NEST will not work with this version of PyNN. The full installation instructions are available in the file INSTALL, which you can find in the NEST source package, or at ``_. .. note:: NumPy must be installed *before* installing NEST. .. note:: Make sure you have the GNU Scientific Library (GSL) installed, otherwise some PyNN standard models (e.g. :class:`IF_cond_exp`) will not be available. On Linux, most Unix variants and Mac OS X, installation is usually as simple as:: $ ./configure --with-mpi $ make $ make install This will install PyNEST to your Python :file:`site-packages` directory. If you wish to install it elsewhere, see the full installation instructions. Now try it out:: $ cd ~ $ python >>> import nest -- N E S T -- Copyright (C) 2004 The NEST Initiative Version 2.6.0 Jan 6 2015 10:31:20 ... >>> nest.Models() (u'ac_generator', u'aeif_cond_alpha', u'aeif_cond_alpha_RK5', u'aeif_cond_alpha_multisynapse', ... Check that ``'aeif_cond_alpha'`` is in the list of models. If it is not, you may need to install a newer version of the `GNU Scientific Library`_ and then recompile NEST. Installing Brian ================ Instructions for downloading and installing Brian_ are available from ``_. Note that this version of PyNN works with Brian 1.4, but not with Brian 2. .. _PyNN: http://neuralensemble.org/PyNN .. _NumPy: http://www.numpy.org/ .. _lazyarray: https://pypi.python.org/pypi/lazyarray .. _CSA: https://software.incf.org/software/csa/ .. _Jinja2: http://jinja.pocoo.org/ .. _Cheetah: http://www.cheetahtemplate.org/ .. _mpi4py: http://mpi4py.scipy.org/ .. _pip: http://www.pip-installer.org/ .. _PCSIM: http://www.lsm.tugraz.at/pcsim/ .. _Brian: http://briansimulator.org/ .. _`PyNN download page`: https://neuralensemble.org/trac/PyNN/wiki/Download .. _`distutils`: http://docs.python.org/2/install/index.html .. _`GNU Scientific Library`: http://www.gnu.org/software/gsl/ .. _`NEURON Forum`: http://www.neuron.yale.edu/phpBB/index.php .. _Neo: http://neuralensemble.org/neo .. _virtualenv: https://virtualenv.readthedocs.org/ .. _Conda: http://conda.pydata.org