Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A module for modeling Local Field Potentials built on NEURON

Project Description


LFPy is a Python-module for calculation of extracellular potentials from multicompartment neuron models. It relies on the NEURON simulator ( and uses the Python interface ( it provides.

LFPy provides a set of easy-to-use Python classes for setting up your model, running your simulations and calculating the extracellular potentials arising from activity in your model neuron. If you have a model working in NEURON ( already, it is likely that it can be adapted to work with LFPy.

The extracellular potentials are calculated from transmembrane currents in multi-compartment neuron models using the line-source method (Holt & Koch, J Comp Neurosci 1999), but a simpler point-source method is also available. The calculations assume that the neuron are surrounded by an infinite extracellular medium with homogeneous and frequency independent conductivity, and compartments are assumed to be at least at a minimal distance from the electrode (which can be specified by the user). For more information on the biophysics underlying the numerical framework used see this coming book chapter:

In the present version, LFPy is mainly designed for simulation of single neurons, described in our recent paper on the package in Frontiers in Neuroinformatics entitled “LFPy: A tool for biophysical simulation of extracellular potentials generated by detailed model neurons”. The article can be found at

Citation: Linden H, Hagen E, Leski S, Norheim ES, Pettersen KH and Einevoll GT (2013). LFPy: A tool for biophysical simulation of extracellular potentials generated by detailed model neurons. Front. Neuroinform. 7:41. doi: 10.3389/fninf.2013.00041

LFPy was developed in the Computational Neuroscience Group, Department of Mathemathical Sciences and Technology (, at the Norwegian University of Life Sciences (, in collaboration with the Laboratory of Neuroinformatics (, Nencki Institute of Experimental Biology (, Warsaw, Poland. The effort was supported by International Neuroinformatics Coordinating Facility (, the Research Council of Norway ( (eScience, NevroNor) and EU-FP7 (BrainScaleS,

For updated information on LFPy and online documentation, see the LFPy homepage (

This scientific software is released under the GNU Public License GPLv3.


To install LFPy you will need the following:

  • Python modules numpy, scipy and matplotlib

  • NEURON (from compiled as a Python module, so the following should execute without error in Python console:

    import neuron
  • Cython (C-extensions for python, to speed up simulations of extracellular fields


There are few options to install LFPy:

  1. From the Python Package Index with only local access using pip

    pip install --user LFPy

    as sudoer:

    sudo pip install LFPy
  2. From the Python Package Index with only local access using easy_install

    easy_install --user LFPy

    as sudoer:

    sudo easy_install LFPy
  3. From source:

    tar -xzf LFPy-x.x.tar.gz
    cd LFPy-x.x
    (sudo) python install (--user)
  4. Development version from the GitHub repository:

    git clone
    cd LFPy
    (sudo) python install (--user)


To generate the html documentation issue from the LFPy source code directory:

sphinx-build -b html /path/to/LFPy/documentation/sources path/to/dest

The main html file is now in path/to/dest/index.html

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
LFPy-1.1.3.tar.gz (999.3 kB) Copy SHA256 Checksum SHA256 Source Jan 18, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting