Installation Guide

Dependencies

Colour requires various dependencies in order to run. Depending your intended use case, i.e. using or developing, you may not need to install all of them.

Please refer to the Installation Methods for Using Colour and Installation Methods for Developing Colour sections below.

Primary Dependencies

Optional Dependencies

Plotting Dependencies

Installation Methods for Using Colour

Pypi

Colour can be easily installed from the Python Package Index by issuing this command in a shell:

$ pip install colour-science

This asciicast demonstrates how to generate a pristine Python VirtualEnv environment for Colour:

The optional features dependencies are installed as follows:

$ pip install 'colour-science[optional]'

The development dependencies are installed as follows:

$ pip install 'colour-science[development]'

The figures plotting dependencies are installed as follows:

Note

Graphviz might need to be installed beforehand, please refer to the specific section for your platform on the Graphviz download page.
$ pip install 'colour-science[plotting]'

If you wish to read OpenEXR files, you will need to install the FreeImage plugin for Imageio as follows:

$ python -c "import imageio;imageio.plugins.freeimage.download()"

Continuum Analytics Anaconda

Colour is also available for Anaconda from Continuum Analytics via conda-forge:

$ conda install -c conda-forge colour-science

This asciicast demonstrates how to generate a pristine Python conda environment for Colour:

Github

Alternatively, you can also install directly from Github source repository:

$ git clone git://github.com/colour-science/colour.git
$ cd colour
$ pip install .

Installation Methods for Developing Colour

Poetry

Colour adopts Poetry to help managing its dependencies, this is the recommended way to get started with Colour development.

Assuming Python>=3.5 is available on your system, the development dependencies are installed with Poetry as follows:

$ git clone git://github.com/colour-science/colour.git
$ cd colour
$ poetry install --extras "optional plotting"
Warning

As of this writing, we are still supporting Python 2.7 which might produce issues when resolving dependencies with a Python 3.8 interpreter. We are indeed effectively patching the pyproject.toml file on Github Actions:
$ sed -i.bak 's/python = "~2.7 || ^3.5"/python = "^3.6"/g' pyproject.toml
$ sed -i.bak 's/matplotlib = { version = "\*"/matplotlib = { version = "^3.1"/g' pyproject.toml
$ git diff --unified=1
diff --git a/pyproject.toml b/pyproject.toml
index 93088d8c..c2b282cf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -46,3 +46,3 @@ classifiers = [
 [tool.poetry.dependencies]
-python = "~2.7 || ^3.5"
+python = "^3.6"
 imageio = "*"
@@ -58,3 +58,3 @@ invoke = { version = "*", optional = true }  # Development dependency.
 jupyter = { version = "*", optional = true }  # Development dependency.
-matplotlib = { version = "*", optional = true }
+matplotlib = { version = "^3.1", optional = true }
 mock = { version = "*", optional = true }  # Development dependency.

If Graphviz is available on your system, you might issue the following commands instead of the aforementioned ones:

$ git clone git://github.com/colour-science/colour.git
$ cd colour
$ poetry install --extras "graphviz optional plotting"

Those commands will create a Virtual Environment in which all the required python packages will be installed.

Tools can then be run as follows:

$ poetry run invoke -l

or alternatively:

$ source $(poetry env info -p)/bin/activate
$ invoke -l

Vagrant

An easy way to get all the pre-requisites at once is to use our colour-vagrant environment for Vagrant.

Please refer to the dedicated blog post for more details about its deployment: PyCharm, Vagrant, Ansible & Poetry