Installation

SPORCO is supported under Python 3.x. It is currently also expected to function correctly under Python 2.7, but this is not expected to continue indefinitely, and use under Python 2.7 is no longer supported.

The simplest way to install the most recent release of SPORCO from PyPI is

pip install sporco

SPORCO can also be installed from source, either from the development version from GitHub, or from a release source package downloaded from PyPI.

To install the development version from GitHub, either do

pip install git+https://github.com/bwohlberg/sporco

or

git clone https://github.com/bwohlberg/sporco.git

followed by

cd sporco
python setup.py build
python setup.py test
python setup.py install

Please report any test failures. The install command will usually have to be performed with root permissions, e.g. on Ubuntu Linux

sudo -H pip install sporco

or

sudo python setup.py install

The procedure for installing from a source package downloaded from PyPI is similar.

SPORCO can also be installed as a conda package from the conda-forge channel

conda install -c conda-forge sporco

A summary of the most significant changes between SPORCO releases can be found in the CHANGES.rst file. It is strongly recommended to consult this summary when updating from a previous version.

Requirements

The primary requirements are Python itself, and modules future, numpy, scipy, imageio, pyfftw, and matplotlib. Installation of these requirements is system dependent:

Under Ubuntu Linux 20.04, the following commands should be sufficient for Python 3

sudo apt-get -y install python3-numpy python3-scipy python3-numexpr python3-matplotlib \
                        python3-imageio python3-pip python3-future libfftw3-dev python3-pytest
sudo -H pip3 install pyfftw pytest-runner

The following optional dependencies are required only for the PPP usage examples, for which Python 3 is required

sudo apt-get -y install libopenblas-base
sudo -H pip3 install bm3d

Some additional dependencies are required for building the documentation from the package source, for which Python 3.3 or later is required

sudo apt-get -y install python3-sphinx python3-numpydoc python3-pygraphviz pandoc
sudo -H pip3 install sphinxcontrib-bibtex sphinx_tabs sphinx_fontawesome jonga \
                     jupyter py2jn

In addition to the required packages, a number of optional packages enable additional features when installed:

Optional Package

Features Supported

numexpr

Acceleration of some functions in sporco.linalg

mpldatacursor

Data cursor enabled for plot.plot, plot.contour, and plot.imview

cupy

GPU acceleration of modules in sporco.cupy

wurlitzer

Utility that supports capture of sporco.cuda function output within Jupyter notebooks

GPUtil

Additional utility functions in sporco.cupy

mpi4py

Parallel computation of the grid search in sporco.mpiutil

bm3d

Required by demo scripts for admm.ppp and pgm.ppp

colour_demosaicing

Required by demo scripts for admm.ppp and pgm.ppp