Installation Guide

Table of Contents

  1. From PyPI

    1. Milestone release

    2. Weekly preview release

  2. From GitHub

    1. System-wide

    2. Editable

  3. Validating the install

  4. MONAI version string

  5. From DockerHub

  6. Installing the recommended dependencies

MONAI’s core functionality is written in Python 3 (>= 3.6) and only requires Numpy and Pytorch.

The package is currently distributed via Github as the primary source code repository, and the Python package index (PyPI). The pre-built Docker images are made available on DockerHub.

To install optional features such as handling the NIfTI files using Nibabel, or building workflows using Pytorch Ignite, please follow the instructions:

From PyPI

Milestone release

To install the current milestone release:

pip install monai

Weekly preview release

To install the weekly preview release:

pip install monai-weekly

The weekly build is released to PyPI every Sunday with a pre-release build number dev[%y%U]. To report any issues on the weekly preview, please include the version and commit information:

python -c "import monai; print(monai.__version__); print(monai.__commit_id__)"

From GitHub

(If you have installed the PyPI release version using pip install monai, please run pip uninstall monai before using the commands from this section. Because pip by default prefers the milestone release.)

The milestone versions are currently planned and released every few months. As the codebase is under active development, you may want to install MONAI from GitHub for the latest features:

Option 1 (as a part of your system-wide module):

pip install git+

or, to build with MONAI Cpp/CUDA extensions:

BUILD_MONAI=1 pip install git+

To build the extensions, if the system environment already has a version of Pytorch installed, --no-build-isolation might be preferred:

BUILD_MONAI=1 pip install --no-build-isolation git+

this command will download and install the current dev branch of MONAI from GitHub.

This documentation website by default shows the information for the latest version.

Option 2 (editable installation):

To install an editable version of MONAI, it is recommended to clone the codebase directly:

git clone

This command will create a MONAI/ folder in your current directory. You can install it by running:

python develop

or, to build with MONAI Cpp/CUDA extensions and install:

BUILD_MONAI=1 python develop
# for MacOS
BUILD_MONAI=1 CC=clang CXX=clang++ python develop

To uninstall the package please run:

python develop --uninstall

# to further clean up the MONAI/ folder (Bash script)
./ --clean

Alternatively, simply adding the root directory of the cloned source code (e.g., /workspace/Documents/MONAI) to your $PYTHONPATH and the codebase is ready to use (without the additional features of MONAI C++/CUDA extensions).

Validating the install

You can verify the installation by:

python -c 'import monai; monai.config.print_config()'

If the installation is successful, this command will print out the MONAI version information, and this confirms the core modules of MONAI are ready-to-use.

MONAI version string

The MONAI version string shows the current status of your local installation. For example:

MONAI version: 0.1.0+144.g52c763d.dirty
  • 0.1.0 indicates that your installation is based on the 0.1.0 milestone release.

  • +144 indicates that your installation is 144 git commits ahead of the milestone release.

  • g52c763d indicates that your installation corresponds to the git commit hash 52c763d.

  • dirty indicates that you have modified the codebase locally, and the codebase is inconsistent with 52c763d.

From DockerHub

Make sure you have installed the NVIDIA driver and Docker 19.03+ for your Linux distribution. Note that you do not need to install the CUDA toolkit on the host, but the driver needs to be installed. Please find out more information on nvidia-docker.

Assuming that you have the Nvidia driver and Docker 19.03+ installed, running the following command will download and start a container with the latest version of MONAI. The latest dev branch of MONAI from GitHub is included in the image.

docker run --gpus all --rm -ti --ipc=host projectmonai/monai:latest

You can also run a milestone release docker image by specifying the image tag, for example:

docker run --gpus all --rm -ti --ipc=host projectmonai/monai:0.1.0