This is a virtualenv-friendly docker image for testing scientific python code on Ubuntu 16.04. Currently, numpy, scipy, and matplotlib (including TeX rendering in plots) are supported, which means you can say:
docker run -it amirkdv/science-py-env pip install numpy scipy matplotlib
For convenience, a virtual environment is already created in $SCI_PY_ENV
(default is /sci-py-env
) where numpy, scipy, and matplotlib are installed. Furthermore, all necessary packages are installed for rendering TeX in matplotlib images (which means the texlive
and texlive-latex-extra
are also installed).
All core scientific computing packages for python have system-level dependencies that are not installable entirely from PyPI. This has lead to the creation of platform-dependent packages which include system dependencies in addition to PyPI packages, e.g. for Debian python-numpy, python-scipy, and python-matplotlib. However, since a virtual environment cannot be passed down to the system-level package installer, this solution makes building testing enviroments complicated.
There is an apt-get
command called build-dep
which comes close to what is needed. The issue with it is that it does not just install the dependent packages but also everything needed for getting a build environment for the package (cf. docs on Depends
and Build-Depends
). So, if we were to say:
apt-get build-dep python-numpy
the python package would not get installed (good) but a large list of other system packages would be installed (bad).