install.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. .. _install:
  2. ************
  3. Installation
  4. ************
  5. The easiest way to install Elephant is by creating a conda environment, followed by ``pip install elephant``.
  6. Below is the explanation of how to proceed with these two steps.
  7. .. _prerequisites:
  8. Prerequisites
  9. =============
  10. Elephant requires `Python <http://python.org/>`_ 2.7, 3.5, 3.6, 3.7, or 3.8.
  11. .. tabs::
  12. .. tab:: (recommended) Conda (Linux/MacOS/Windows)
  13. 1. Create your conda environment (e.g., `elephant`):
  14. .. code-block:: sh
  15. conda create --name elephant python=3.7 numpy scipy tqdm
  16. 2. Activate your environment:
  17. .. code-block:: sh
  18. conda activate elephant
  19. .. tab:: Debian/Ubuntu
  20. Open a terminal and run:
  21. .. code-block:: sh
  22. sudo apt-get install python-pip python-numpy python-scipy python-pip python-six python-tqdm
  23. Installation
  24. ============
  25. .. tabs::
  26. .. tab:: Stable release version
  27. The easiest way to install Elephant is via `pip <http://pypi.python.org/pypi/pip>`_:
  28. .. code-block:: sh
  29. pip install elephant
  30. If you want to use advanced features of Elephant, install the package
  31. with extras:
  32. .. code-block:: sh
  33. pip install elephant[extras]
  34. To upgrade to a newer release use the ``--upgrade`` flag:
  35. .. code-block:: sh
  36. pip install --upgrade elephant
  37. If you do not have permission to install software systemwide, you can
  38. install into your user directory using the ``--user`` flag:
  39. .. code-block:: sh
  40. pip install --user elephant
  41. .. tab:: Development version
  42. If you have `Git <https://git-scm.com/>`_ installed on your system,
  43. it is also possible to install the development version of Elephant.
  44. 1. Before installing the development version, you may need to uninstall
  45. the previously installed version of Elephant:
  46. .. code-block:: sh
  47. pip uninstall elephant
  48. 2. Clone the repository and install the local version:
  49. .. code-block:: sh
  50. git clone git://github.com/NeuralEnsemble/elephant.git
  51. cd elephant
  52. .. tabs::
  53. .. tab:: Minimal setup
  54. .. code-block:: sh
  55. pip install -e .
  56. .. tab:: conda (with extras)
  57. .. code-block:: sh
  58. conda remove -n elephant --all # remove the previous environment
  59. conda env create -f requirements/environment.yml
  60. conda activate elephant
  61. pip install -e .
  62. MPI support
  63. -----------
  64. Some Elephant modules (ASSET, SPADE, etc.) are parallelized to run with MPI.
  65. In order to make use of MPI parallelization, you need to install ``mpi4py``
  66. package:
  67. .. tabs::
  68. .. tab:: conda (easiest)
  69. .. code-block:: sh
  70. conda install -c conda-forge mpi4py
  71. .. tab:: pip (Debian/Ubuntu)
  72. .. code-block:: sh
  73. sudo apt install -y libopenmpi-dev openmpi-bin
  74. pip install mpi4py
  75. To run a python script that supports MPI parallelization, run in a terminal:
  76. .. code-block:: sh
  77. mpiexec -n numprocs python -m mpi4py pyfile [arg] ...
  78. For more information, refer to `mpi4py
  79. <https://mpi4py.readthedocs.io/en/stable/mpi4py.run.html>`_ documentation.
  80. Dependencies
  81. ------------
  82. Elephant relies on the following packages (automatically installed when you
  83. run ``pip install elephant``):
  84. * `quantities <http://pypi.python.org/pypi/quantities>`_ - support for physical quantities with units (mV, ms, etc.)
  85. * `neo <http://pypi.python.org/pypi/neo>`_ - electrophysiology data manipulations