Skip to content

Installation

1: Create a virtual environment

Create and activate a virtual environment to install the current package, e.g. using conda (please refer to their site for questions about creating the environment):

conda activate # ensures you are in the base environment
conda create -n neurogym python=3.11 -y
conda activate neurogym

2: Install NeuroGym

Install the latest stable release of neurogym using pip:

pip install neurogym

2a: Reinforcement Learning Support

NeuroGym includes optional reinforcement learning (RL) features via Stable-Baselines3. To install these, choose one of the two options below depending on your hardware setup:

NeuroGym includes optional reinforcement learning (RL) features via Stable-Baselines3. To install these, choose one of the two options below depending on your hardware setup:

pip install neurogym[rl]

NOTE for Linux/WSL users: If you do not have access to a CUDA-capable NVIDIA GPU (which is the case for most users), above line will install up to 1.5GB of unnecessary GPU libraries. To avoid excessive overhead, we recommend first isntalling the CPU-only version of PyTorch:

pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install neurogym[rl]

2b: Editable/Development Mode

To contribute to NeuroGym or run it from source with live code updates:

git clone https://github.com/neurogym/neurogym.git
cd neurogym
pip install -e .

This installs the package in editable mode, so changes in source files are reflected without reinstalling.

To include both RL and development tools (e.g., for testing, linting, documentation):

pip install -e .[rl,dev]

Step 3 (Optional): Psychopy installation

NOTE: psycohopy installation is currently not working

If you need psychopy for your project, additionally run

pip install psychopy