The easiest way to install Elephant is by creating a conda environment, followed by pip install elephant. Below is the explanation of how to proceed with these two steps.


Elephant requires Python 2.7, 3.5, 3.6, 3.7, or 3.8.

  1. Create your conda environment (e.g., elephant):

    conda create --name elephant python=3.7 numpy scipy tqdm
  2. Activate your environment:

    conda activate elephant

Open a terminal and run:

sudo apt-get install python-pip python-numpy python-scipy python-pip python-six python-tqdm


The easiest way to install Elephant is via pip:

pip install elephant

If you want to use advanced features of Elephant, install the package with extras:

pip install elephant[extras]

To upgrade to a newer release use the --upgrade flag:

pip install --upgrade elephant

If you do not have permission to install software systemwide, you can install into your user directory using the --user flag:

pip install --user elephant

If you have Git installed on your system, it is also possible to install the development version of Elephant.

  1. Before installing the development version, you may need to uninstall the previously installed version of Elephant:

    pip uninstall elephant
  2. Clone the repository and install the local version:

    git clone git://
    cd elephant
pip install -e .
conda remove -n elephant --all  # remove the previous environment
conda env create -f requirements/environment.yml
conda activate elephant
pip install -e .

MPI support

Some Elephant modules (ASSET, SPADE, etc.) are parallelized to run with MPI. In order to make use of MPI parallelization, you need to install mpi4py package:

conda install -c conda-forge mpi4py
sudo apt install -y libopenmpi-dev openmpi-bin
pip install mpi4py

To run a python script that supports MPI parallelization, run in a terminal:

mpiexec -n numprocs python -m mpi4py pyfile [arg] ...

For more information, refer to mpi4py documentation.


Elephant relies on the following packages (automatically installed when you run pip install elephant):

  • quantities - support for physical quantities with units (mV, ms, etc.)
  • neo - electrophysiology data manipulations