Installation#
Your system needs a:
C compiler,
C++ compiler, and
a version of Python supported by
scikit-image(see pyproject.toml).
First, fork the scikit-image repository on GitHub.
Then clone your fork locally and set an upstream remote to point to the original scikit-image repository:
Note
We use git@github.com below; if you don’t have SSH keys setup, use
https://github.com instead.
git clone git@github.com:YOURUSERNAME/scikit-image
cd scikit-image
git remote add upstream git@github.com:scikit-image/scikit-image
All commands below are run from within the cloned scikit-image directory.
Build environment setup#
Set up a Python development environment tailored for scikit-image.
Here we provide instructions for two popular environment managers:
venv (pip) and conda (miniforge).
venv#
# Create a virtualenv named ``skimage-dev`` that lives outside of the repository.
# One common convention is to place it inside an ``envs`` directory under your home directory:
mkdir ~/envs
python -m venv ~/envs/skimage-dev
# Activate it
# (On Windows, use ``skimage-dev\Scripts\activate``)
source ~/envs/skimage-dev/bin/activate
# Install development dependencies
pip install -r requirements.txt
# Install scikit-image in editable mode. In editable mode,
# scikit-image will be recompiled, as necessary, on import.
spin install -v
Tip
The above installs scikit-image into your environment, which makes it accessible to IDEs, IPython, etc. This is not strictly necessary; you can also build with:
spin build
In that case, the library is not installed, but is accessible via
spin commands, such as spin test, spin ipython, spin run,
etc.
conda#
We recommend installing conda using miniforge, an alternative to Anaconda without licensing costs.
After installing miniforge:
# Create a conda environment with required dependencies
conda env create -f environment.yml
# Activate it
conda activate skimage-dev
# Install scikit-image in editable mode. In editable mode,
# scikit-image will be recompiled, as necessary, on import.
spin install -v
Tip
The above installs scikit-image into your environment, which makes it accessible to IDEs, IPython, etc. This is not strictly necessary; you can also build with:
spin build
In that case, the library is not installed, but is accessible via
spin commands, such as spin test, spin ipython, spin run,
etc.
Adding a feature branch#
When contributing a new feature, do so via a feature branch.
First, fetch the latest source:
git switch main
git pull upstream main
Create your feature branch:
git switch --create my-feature-name
Using an editable install, scikit-image will rebuild itself as
necessary.
If you are building manually, rebuild with:
spin build
Repeated, incremental builds usually work just fine, but if you notice build problems, rebuild from scratch using:
spin build --clean
Platform-specific notes#
Windows
Building scikit-image on Windows is done as part of our continuous
integration testing; the steps are shown in this Azure Pipeline.
Debian and Ubuntu
Install suitable compilers prior to library compilation:
sudo apt-get install build-essential
Full requirements list#
Build Requirements
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
meson-python>=0.16
ninja>=1.11.1.3
Cython>=3.2
pythran>=0.16
numpy>=2.2
spin>=0.14
build>=1.3
Runtime Requirements
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
numpy>=2.2
scipy>=1.15; sys_platform != "emscripten"
scipy>=1.14; sys_platform == "emscripten"
networkx>=3.4
pillow>=10.1
imageio>=2.33,!=2.35.0
tifffile>=2025.1.10
packaging>=24
lazy-loader>=0.6
Test Requirements
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
numpydoc>=1.7
pooch>=1.6.0; sys_platform != "emscripten"
pytest>=9
pytest-cov>=2.11.0
pytest-pretty
pytest-localserver
pytest-faulthandler
pytest-doctestplus>=1.6.0
Documentation Requirements
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
sphinx>=8.0
sphinx-gallery[parallel]>=0.20
numpydoc>=1.7
sphinx-copybutton
sphinx-togglebutton
matplotlib>=3.10
dask[array]>=2025.1.0
pandas>=2.3
seaborn>=0.13
pooch>=1.6
tifffile>=2025.1.10
myst-parser
intersphinx-registry>=0.2411.14
ipywidgets
ipykernel
plotly>=6.1.1
kaleido>=1.0
scikit-learn>=1.6
sphinx_design>=0.5
pydata-sphinx-theme>=0.17
PyWavelets>=1.7
pytest-doctestplus>=1.6.0
Developer Requirements
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
pre-commit
ipython
docstub==0.7.0rc0
asv; sys_platform != "emscripten"
Data Requirements
The full selection of demo datasets is only available with the following installed:
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
pooch>=1.6.0
Optional Requirements
You can use scikit-image with the basic requirements listed above, but some
functionality is only available with the following installed:
Matplotlib Used in various functions, e.g., for drawing, segmenting, reading images.
Dask The
daskmodule is used to parallelize certain functions.
More rarely, you may also need:
PyAMG The
pyamgmodule is used for the fastcg_mgmode of random walker segmentation.Astropy Provides FITS I/O capability.
SimpleITK Optional I/O plugin providing a wide variety of formats. including specialized formats used in biomedical imaging.
# Generated via tools/generate_requirements.py and pre-commit hook.
# Do not edit this file; modify pyproject.toml instead.
SimpleITK; sys_platform != "emscripten"
scikit-learn>=1.6
pyamg>=5.2; sys_platform != "emscripten" and python_version < "3.14"
astropy>=6.1
dask[array]>=2025.1.0
matplotlib>=3.10; sys_platform != "emscripten"
pooch>=1.6.0; sys_platform != "emscripten"
PyWavelets>=1.7
Help with contributor installation#
See Additional help.