On a local machine not connected to a Loihi host,
you can use any version of Python
pip install nengo-loihi
pip will do its best to install
If anything goes wrong during this process,
it is likely related to installing NumPy.
Follow our NumPy install instructions,
then try again.
These steps will take you through setting up a Python environment for running NengoLoihi, as well as for running models using the NxSDK directly.
Note, you must use Python 3.5.2 when working with NxSDK. The easiest way to satisfy those constraints is to use Miniconda to set up an isolated environment for running Loihi models.
To see if it is available, run
If conda is available, the conda version should be printed to the console.
If it is not available:
Ask your superhost administrator if conda is installed. If it is, you need to add the
bindirectory of the conda installation to your path.
Running this once will change your path for the current session. Adding it to a shell configuration file (e.g.,
~/.bashrc) will change your path for all future terminal sessions.
If conda is not installed, install Miniconda.
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh bash miniconda.sh
Follow the prompts to set up Miniconda as desired.
Create a new
You must use Python 3.5.2 when working with NxSDK. Python 3.5.2 is not available in the default
condachannels, so you must pass
--channel conda-forgeto the command below.
conda create --channel conda-forge --name loihi python=3.5.2
Activate your new environment.
source activate loihi
Sometimes the environment can have issues when first created. Before continuing, run
which pipand ensure that the path to
pipis in your conda environment.
You will need to run
source activate loihievery time you log onto the superhost.
Install NumPy and Cython with conda.
conda install numpy cython
The NumPy provided by conda is usually faster than those installed by other means.
Copy the latest NxSDK release to your current directory.
The location of NxSDK may have changed. Refer to Intel’s documentation to be sure. The most recent release and NxSDK location are current as of November, 2019.
If you are logged into INRC:
cp /nfs/ncl/releases/0.9.0/nxsdk-0.9.0.tar.gz .
If you are setting up a non-INRC superhost:
scp <inrc-host>:/nfs/ncl/releases/0.9.0/nxsdk-0.9.0.tar.gz .
pip install nxsdk-0.9.0.tar.gz
pip install nengo-loihi
pipwill install other requirements like Nengo automatically.
Test that both packages installed correctly.
Start Python by running the
pythoncommand. If everything is installed correctly, you should be able to import
Python 3.5.2 |Anaconda, Inc.| (default, May 13 2018, 21:12:35) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import nxsdk >>> import nengo_loihi
If you plan to make changes to NengoLoihi,
you should perform a developer install.
All of the steps above are the same
with a developer install,
except that instead of doing
pip install nengo-loihi,
you should do
git clone https://github.com/nengo/nengo-loihi.git pip install -e nengo-loihi cd nengo-loihi pre-commit install