How to install skimage
How to install skimage
scikit-image 0.19.3
pip install scikit-image Copy PIP instructions
Released: Jun 12, 2022
Image processing in Python
Navigation
Project links
Statistics
View statistics for this project via Libraries.io, or by using our public dataset on Google BigQuery
License: BSD License (Modified BSD)
Requires: Python >=3.7
Maintainers
Classifiers
Project description
scikit-image: Image processing in Python
Installation from binaries
Installation from source
Install dependencies using:
Then, install scikit-image using:
If you plan to develop the package, you may run it directly from source:
Every time you modify Cython files, also run:
License (Modified BSD)
Copyright (C) 2011, the scikit-image team All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE AUTHOR «AS IS» AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Citation
If you find this project useful, please cite:
scikit-image/scikit-image
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
scikit-image: Image processing in Python
Installation from binaries
Installation from source
Install dependencies using:
Then, install scikit-image using:
If you plan to develop the package, you may run it directly from source:
Every time you modify Cython files, also run:
License (Modified BSD)
Copyright (C) 2011, the scikit-image team All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE AUTHOR «AS IS» AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
If you find this project useful, please cite:
Installing scikit-image¶
Standard Python installation¶
From the shell, execute:
Conda-based distributions (Anaconda, Miniconda)¶
From the shell/command prompt, execute:
Windows¶
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 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¶
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.
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¶
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.
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).
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:
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
A run-through of the compilation process for Windows is included in our setup of Azure Pipelines (a continuous integration service).
How to install skimage
Copy raw contents
Copy raw contents
How you should install scikit-image depends on your needs and skills:
For information on other platforms, see other platforms.
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.
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.
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.
Once you have your conda environment set up, you can install scikit-image with the command:
System package managers
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:
We still support Windows 32-bit on x86 processors but urge switching to Windows 64-bit.
Unsupported platforms include:
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.
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:
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).
On Windows, please use skimage-dev\Scripts\activate on the activation step.
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:
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:
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:
Windows
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:
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.