- Installing scikit-image¶
- Supported platforms¶
- Version check¶
- Scientific Python distributions¶
- Installation via pip and conda¶
- conda¶
- System package managers¶
- Downloading all demo datasets¶
- Other platforms¶
- Additional help¶
- Installing scikit-image for contributors¶
- Build environment setup¶
- conda¶
- Updating the installation¶
- Testing¶
- Warnings during testing phase¶
- Platform-specific notes¶
- Full requirements list¶
- Installing scikit-image¶
- Standard Python installation¶
- Conda-based distributions (Anaconda, Miniconda)¶
- Windows¶
- Debian and Ubuntu¶
- Building from source¶
- Windows¶
- Debian and Ubuntu¶
- Running the development version¶
- Building with bento¶
- Build Requirements¶
- Runtime requirements¶
- Optional Requirements¶
- Testing requirements¶
- Documentation requirements¶
- Installing scikit-image¶
- 1. Standard Installation:¶
- a. Windows¶
- b. Debian and Ubuntu¶
- 2. Development Installation:¶
- a. Windows¶
- b. Debian and Ubuntu¶
- c. Building with bento¶
- Build Requirements¶
- Runtime requirements¶
- Optional Requirements¶
- Testing requirements¶
- Documentation requirements¶
Installing scikit-image¶
How you should install scikit-image depends on your needs and skills:
If you can install Python packages and work in virtual environments:
Easy solution but with pitfalls: system package manager (yum, apt, …).
Supported platforms¶
Windows 64-bit on x86 processors
Mac OS X on x86 processors
Linux 64-bit on x86 processors
For information on other platforms, see other platforms.
Version check¶
To see whether scikit-image is already installed or to check if an install has worked, run the following in a Python shell or Jupyter notebook:
or, from the command line:
(Try python3 if python is unsuccessful.)
You’ll see the version number if scikit-image is installed and an error message otherwise.
Scientific Python distributions¶
In a single install these give you Python, scikit-image and libraries it depends on, and other useful scientific packages. They install into an isolated environment, so they won’t conflict with any existing installed programs.
Drawbacks are that the install can be large and you may not get the most recent scikit-image .
We recommend one of these distributions:
When using the scikit-image documentation, make sure it’s for the version you’ve installed (see Version check above).
Installation via pip and conda¶
These install only scikit-image and its dependencies; pip has an option to include related packages.
Prerequisites to a pip install: You’re able to use your system’s command line to install packages and are using a virtual environment (any of several).
While it is possible to use pip without a virtual environment, it is not advised: virtual environments create a clean Python environment that does not interfere with any existing system installation, can be easily removed, and contain only the package versions your application needs. They help avoid a common challenge known as dependency hell.
To install the current scikit-image you’ll need at least Python 3.6. If your Python is older, pip will find the most recent compatible version.
To include a selection of other scientific Python packages that expand scikit-image ’s capabilities to include, e.g., parallel processing, you can install the package scikit-image[optional] :
Please do not use the command sudo and pip together as pip may overwrite critical system libraries which may require you to reinstall your operating system.
conda¶
Miniconda is a bare-essentials version of the Anaconda package; you’ll need to install packages like scikit-image yourself. Like Anaconda, it installs Python and provides virtual environments.
conda-forge, a conda channel maintained with the latest scikit-image package
Once you have your conda environment set up, you can install scikit-image with the command:
System package managers¶
Using a package manager ( yum , apt-get , etc.) to install scikit-image or other Python packages is not your best option:
You’re likely to get an older version.
You’ll probably want to make updates and add new packages outside of the package manager, leaving you with the same kind of dependency conflicts you see when using pip without a virtual environment.
There’s an added risk because operating systems use Python, so if you make system-wide Python changes (installing as root or using sudo), you can break the operating system.
Downloading all demo datasets¶
Some of the data used in our examples is hosted online and is not installed by default by the procedures explained above. Data are downloaded once, at the first call, but this requires an internet connection. If you prefer downloading all the demo datasets to be able to work offline, you can run this command:
or call download_all() in your favourite interactive Python environment (IPython, Jupyter notebook, …).
Other platforms¶
We still support Windows 32-bit on x86 processors but urge switching to Windows 64-bit.
Unsupported platforms include:
Linux on 32-bit x86 processors.
Linux on 32-bit on ARM processors (Raspberry Pi running Raspbian):
While we do not officially support this distribution, we point users to piwheels and their scikit-image’s specific page.
You may need to install additional system dependencies listed for imagecodecs. See issue 4721.
Linux on 64-bit ARM processors (Nvidia Jetson):
Follow the conversation on issue 4705.
Although these platforms lack official support, many of the core developers have experience with them and can help with questions.
If you want to install on an unsupported platform, try building from source.
Tell us which other platforms you’d like to see scikit-image on! We are very interested in how scikit-image gets used.
If you’d like to package scikit-image for an as-yet-unsupported platform, reach out on GitHub.
Additional help¶
If you still have questions, reach out through
To suggest a change in these instructions, please open an issue on GitHub.
Installing scikit-image for contributors¶
We are assuming that you have a default Python environment already configured on your computer and that you intend to install scikit-image inside of it.
We also make a few more assumptions about your system:
You have a C compiler set up.
You have a C++ compiler set up.
You are running a version of Python compatible with our system as listed in our setup.py file.
You’ve cloned the git repository into a directory called scikit-image . You have set up the upstream remote to point to our repository and origin to point to your fork.
This directory contains the following files:
All commands below are assumed to be running from the scikit-image directory containing the files above.
Build environment setup¶
Once you’ve cloned your fork of the scikit-image repository, you should set up a Python development environment tailored for scikit-image. You may choose the environment manager of your choice. Here we provide instructions for two popular environment managers: venv (pip based) and conda (Anaconda or Miniconda).
When using venv , you may find the following bash commands useful:
On Windows, please use skimage-dev\Scripts\activate on the activation step.
conda¶
When using conda for development, we recommend adding the conda-forge channel for the most up-to-date version of many dependencies. Some dependencies we use (for testing and documentation) are not available from the default Anaconda channel. Please follow the official conda-forge installation instructions before you get started.
Updating the installation¶
When updating your installation, it is often necessary to recompile submodules that have changed. Do so with the following commands:
Testing¶
scikit-image has an extensive test suite that ensures correct execution on your system. The test suite must pass before a pull request can be merged, and tests should be added to cover any modifications to the code base.
We use the pytest testing framework, with tests located in the various skimage/submodule/tests folders.
Our testing requirements are listed below:
Run all tests using:
Or the tests for a specific submodule:
Or tests from a specific file:
Or a single test within that file:
Use —doctest-modules to run doctests. For example, run all tests and all doctests using:
Warnings during testing phase¶
Scikit-image tries to catch all warnings in its development builds to ensure that crucial warnings from dependencies are not missed. This might cause certain tests to fail if you are building scikit-image with versions of dependencies that were not tested at the time of the release. To disable failures on warnings, export the environment variable SKIMAGE_TEST_STRICT_WARNINGS with a value of 0 or False and run the tests:
Platform-specific notes¶
Windows
If you experience the error Error:unable to find vcvarsall.bat it means that your computer does not have recommended compilers for Python. You can either download and install Windows compilers from here or use MinGW compilers . If using MinGW, make sure to correctly configure distutils by modifying (or create, if not existing) the configuration file distutils.cfg (located for example at C:\Python26\Lib\distutils\distutils.cfg ) to contain:
A run-through of the compilation process for Windows is included in our setup of Azure Pipelines (a continuous integration service).
Debian and Ubuntu
Install suitable compilers:
Full requirements list¶
Build Requirements
Runtime Requirements
Test Requirements
Documentation Requirements
Optional Requirements
You can use scikit-image with the basic requirements listed above, but some functionality is only available with the following installed:
Optional I/O plugin providing a wide variety of formats. including specialized formats using in medical imaging.
Provides FITS I/O capability.
A Qt plugin will provide imshow(x, fancy=True) and skivi.
The pyamg module is used for the fast cg_mg mode of random walker segmentation.
The dask module is used to speed up certain functions.
Extra Requirements
These requirements have been included as a convenience, but are not widely installable through PyPI on our supported platforms. As such, we keep them in a separate list for more advanced members of our community to install.
Optional I/O plugin providing most standard formats.
Installing scikit-image¶
Standard Python installation¶
From the shell, execute:
Conda-based distributions (Anaconda, Miniconda)¶
From the shell/command prompt, execute:
Windows¶
scikit-image comes pre-installed with several Python distributions, including Anaconda, Enthought Canopy, Python(x,y) and WinPython .
If you are using the distribution from python.org, you’ll need to manually download a few packages: numpy, scipy and scikit-image from Christoph Gohlke’s website. Python wheels are installed using:
Debian and Ubuntu¶
On Debian and Ubuntu install scikit-image with:
Building from source¶
Execute the following command from the shell:
Windows¶
If you experience the error Error:unable to find vcvarsall.bat it means that distutils is not correctly configured to use the C compiler. Modify (or create, if not existing) the configuration file distutils.cfg (located for example at C:\Python26\Lib\distutils\distutils.cfg ) to contain:
For more details on compiling in Windows, there is a lot of knowledge iterated into the setup of appveyor (a continuous integration service).
Debian and Ubuntu¶
If your distribution ships an outdated version, you may recompile from source. First install the dependencies:
Then run the pip installation command.
Running the development version¶
Obtain the source from the git repository at http://github.com/scikit-image/scikit-image by running:
After unpacking, change into the source directory and execute:
Building with bento¶
Alternatively, scikit-image can also be built using bento. Bento depends on WAF for compilation.
Tell Bento where to find WAF by setting the WAFDIR environment variable:
From the scikit-image source directory:
Depending on file permissions, the install commands may need to be run as sudo.
Build Requirements¶
Runtime requirements¶
You can use pip to automatically install the runtime dependencies as follows:
Optional Requirements¶
You can use this scikit with the basic requirements listed above, but some functionality is only available with the following installed:
The qt plugin that provides imshow(x, fancy=True) and skivi .
The freeimage plugin provides support for reading various types of image file formats, including multi-page TIFFs.
The pyamg module is used for the fast cg_mg mode of random walker segmentation.
Astropy provides FITS io capability.
SimpleITK Optional io plugin providing a wide variety of formats. including specialized formats using in medical imaging.
imread Optional io plugin providing most standard formats.
Testing requirements¶
A Python Unit Testing Framework
A tool that generates a unit test code coverage report
Documentation requirements¶
sphinx >= 1.3 is required to build the documentation.
Installing scikit-image¶
We are assuming that you have default Python environment already configured on your computer and you intend to install scikit-image inside of it. If you want to create and work with Python virtual environments, please follow instructions on venv and virtual environments.
There are two ways you can install scikit-image on your preferred Python environment.
- Standard Installation
- Development Installation
1. Standard Installation:¶
scikit-image comes pre-installed with several Python distributions, including Anaconda, Enthought Canopy, Python(x,y) and WinPython. However, you can install or upgrade existing scikit-image via shell/command prompt.
a. Windows¶
On Windows, you can install scikit-image using:
For Conda-based distributions (Anaconda, Miniconda), execute:
If you are using pure Python i.e. the distribution from python.org, you’ll need to manually download packages (such as numpy, scipy and scikit-image) using Python wheels available from Christoph Gohlke’s website. You can install Python wheels using:
b. Debian and Ubuntu¶
On Debian and Ubuntu, install scikit-image with:
2. Development Installation:¶
You can install scikit-image development version if either your distribution ships an outdated version or you want to develop and work on new features before the package is released officially.
a. Windows¶
Before installing the development version, uninstall the standard version of scikit-image using pip as:
or using conda (for Anaconda users) as:
Now clone scikit-image on your local computer:
Change the directory and build from source code:
If you experience the error Error:unable to find vcvarsall.bat it means that your computer does not have recommended compilers for python. You can either download and install Windows compilers from here or use MinGW compilers . If using MinGW , make sure to correctly configure distutils by modifying (or create, if not existing) the configuration file distutils.cfg (located for example at C:\Python26\Lib\distutils\distutils.cfg ) to contain:
Once the build process is complete, run:
Make sure to give space after -e and add dot at the end. This will install scikit-image development version and upgrade (or install) all the required dependencies. Otherwise, you can run the following command to skip installation of dependencies:
You can install or upgrade dependencies required for scikit-image anytime after installation using:
For more details on compiling in Windows, there is a lot of knowledge iterated into the setup of appveyor (a continuous integration service).
b. Debian and Ubuntu¶
Install all the required dependencies:
Get suitable compilers for successful installation:
Obtain the source from the git repository at http://github.com/scikit-image/scikit-image by running:
After unpacking, change into the source directory and execute:
c. Building with bento¶
Alternatively, scikit-image can also be built using bento. Bento depends on WAF for compilation.
Tell Bento where to find WAF by setting the WAFDIR environment variable:
From the scikit-image source directory:
Depending on file permissions, the install commands may need to be run as sudo.
Build Requirements¶
Runtime requirements¶
You can use pip to automatically install the runtime dependencies as follows:
Optional Requirements¶
You can use this scikit with the basic requirements listed above, but some functionality is only available with the following installed:
- dask[array] >= 0.5.0. For parallel computation using skimage.util.apply_parallel .
- PyQt4 The qt plugin that provides imshow(x, fancy=True) and skivi .
- FreeImage The freeimage plugin provides support for reading various types of image file formats, including multi-page TIFFs.
- PyAMG The pyamg module is used for the fast cg_mg mode of random walker segmentation.
- Astropy provides FITS io capability.
- SimpleITK Optional io plugin providing a wide variety of formats. including specialized formats using in medical imaging.
- imread Optional io plugin providing most standard formats.
Testing requirements¶
- Nose A Python Unit Testing Framework
- Coverage.py A tool that generates a unit test code coverage report
Documentation requirements¶
sphinx >= 1.3 is required to build the documentation.