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 3.6, 3.7, 3.8, or 3.9.

  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


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

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

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.

CUDA and OpenCL support

Analysis of Sequences of Synchronous EvenTs (ASSET) module supports CUDA and OpenCL. These are experimental features. You can have one, both, or none installed in your system.

To leverage CUDA acceleration on an NVIDIA GPU card, CUDA toolkit must installed on your system. Then run the following command in a terminal:

pip install pycuda

In case you experience issues installing PyCUDA, this guide offers a step-by-step installation manual.

If PyCUDA is detected and installed, CUDA backend is used by default in Elephant ASSET module. To turn off CUDA support, set ELEPHANT_USE_CUDA environment flag to 0.


Elephant relies on two special packages, installed by default:

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