Skip to content

Latest commit

 

History

History
209 lines (144 loc) · 6.98 KB

INSTALL.rst

File metadata and controls

209 lines (144 loc) · 6.98 KB

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 the instructions on venv and virtual environments.

There are two ways you can install scikit-image on your preferred Python environment.

  1. Standard Installation
  2. 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:

pip install scikit-image

For Conda-based distributions (Anaconda, Miniconda), execute:

conda install scikit-image

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:

pip install SomePackage-1.0-py2.py3-none-any.whl

b. Debian and Ubuntu

On Debian and Ubuntu, install scikit-image with:

sudo apt-get install python-skimage

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:

pip uninstall scikit-image

or using conda (for Anaconda users) as:

conda uninstall scikit-image

Now clone scikit-image on your local computer:

git clone https://github.com/scikit-image/scikit-image.git

Change the directory and build from source code:

cd scikit-image
python setup.py develop

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:

[build]
 compiler=mingw32

Once the build process is complete, run:

pip install -U -e .

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:

pip install -U[--no-deps] -e .

You can install or upgrade dependencies required for scikit-image anytime after installation using:

pip install -r requirements.txt --upgrade

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:

sudo apt-get install python-matplotlib python-numpy python-pil python-scipy

Get suitable compilers for successful installation:

sudo apt-get install build-essential cython

Obtain the source from the git repository at http://github.com/scikit-image/scikit-image by running:

git clone https://github.com/scikit-image/scikit-image.git

After unpacking, change into the source directory and execute:

pip install -e .

To update:

git pull  # Grab latest source
python setup.py build_ext -i  # Compile any modified extensions

Build Requirements

Runtime requirements

You can use pip to automatically install the runtime dependencies as follows:

$ pip install -r requirements.txt

Optional Requirements

You can use scikit-image with the basic requirements listed above, but some functionality is only available with the following installed:

  • PyQt4
    The qt plugin that provides imshow(x, fancy=True) and skivi.
  • PyAMG
    The pyamg module is used for the fast cg_mg mode of random walker segmentation.
  • Astropy
    Provides FITS I/O capability.
  • SimpleITK
    Optional I/O plugin providing a wide variety of formats. including specialized formats using in medical imaging.
  • imread
    Optional I/O plugin providing most standard formats.

Testing requirements

  • pytest
    A Python Unit Testing Framework. Required to execute the tests.
  • pytest-cov
    A tool that generates a unit test code coverage report.

Documentation requirements