Installation

It is recommended that you use pip version 8.1.0 or higher to install into NeuroM into a virtualenv. For details on how to set it up, see Virtualenv setup

Once the virtualenv is set up is set up, there are three ways to install NeuroM

  1. From the official Python Package Index server (PyPI)
  2. From the git repository
  3. From source (for NeuroM developers)

Install from the official PyPI server

Install the latest release:

(nrm)$ pip install neurom

Install a specific version:

(nrm)$ pip install neurom==1.2.3

Install from git

Install a particular release:

(nrm)$ pip install git+https://github.com/BlueBrain/NeuroM.git@v0.1.0

Install the latest version:

(nrm)$ pip install git+https://github.com/BlueBrain/NeuroM.git

Install from source

Clone the repository and install it:

(nrm)$ git clone https://github.com/BlueBrain/NeuroM.git
(nrm)$ pip install -e ./NeuroM

This installs NeuroM into your virtualenv in “editable” mode. That means that changes made to the source code after the installation procedure are seen by the installed package. To install in read-only mode, omit the -e.

Virtualenv setup

$ virtualenv nrm           # creates a virtualenv called "nrm" in nrm directory
$ source nrm/bin/activate  # activates virtualenv
(nrm)$                     # now we are in the nrm virtualenv

This will create a virtualenv that is isolated from system-wide python packages. If you prefer to use pre-installed dependencies, you may use the --system-site-packages option, which allows globally installed python packages to be used inside the virtualenv:

$ virtualenv --system-site-packages nrm   # creates a virtualenv called "nrm" in nrm directory

The prompt indicates that the virtualenv has been activated.

For efficient installation of dependencies with C extensions, it is recommended to use pip version 8 or higher. You can check your virtuanenv‘s version with pip --version, and upgrade if it is too low:

$(nrm) pip --version               # Check pip version. Should output version >= 8.0.0
$(nrm) pip install --upgrade pip   # Install newest pip inside virtualenv if version too old.
$(nrm) pip --version               # New version should be >= 8.0.0

This will allow use of pre-compiled python packages most platforms.

To de-activate the virtualenvr run the deactivate command:

(nrm)$ deactivate

Note that you do not have to work in the nrm directory. This is where python packages will get installed, but you can work anywhere on your file system, as long as you have activated the virtualenv.

Note

In following code samples, the prompts (nrm)$ and $ are used to indicate that the user virtualenv is activated or deactivated respectively.

Note

In following code samples, the prompt >>> indicates a python interpreter session started with the virtualenv activated. That gives access to the neurom installation.