Installing ODL using pip¶
pip is a package manager that works on all major platforms and allows user to install python packages in a very simple manner. If you already have python and pip installed, you can go directly to Installing ODL and its dependencies, otherwise you need to begin by installing python and pip.
Correctly installing ODL’s dependencies on Windows, especially Numpy and other compiled dependencies, can be quite a hassle, and we therefore discourage this variant. You should really consider using Anaconda instead.
Instructions for the impatient:
Install ODL and dependencies:
$ pip install odl[show,pywavelets,scikit,proximal,testing]
Installing a Python interpreter¶
Open a terminal and type
python + Enter.
If a Python prompt appears, you already have an interpreter installed and can skip this step (exit by running
Otherwise, you need to install it.
In the unlikely event that Python is not installed, consult your distro package manager.
Installing ODL and its dependencies¶
You may need to install pip to be able to install ODL and its dependencies from the Python Package Index (PyPI).
pip3) shows a help message, it is installed – otherwise you need to install it first.
For basic installation without extra dependencies, run
$ pip install --user odl
The following optional packages extend the functionality of ODL. They can be specified as keywords in square brackets, separated by commas (no spaces!):
$ pip install odl[dep1,dep2]
show: Install matplotlib to enable displaying capabilities.
fft: Install pyFFTW for fast Fourier transforms. Note that this requires the FFTW C library to be available on your system. Note also that even without this dependency, FFTs can be computed with Numpy’s FFT library.
pywavelets: Install PyWavelets for wavelet transforms.
scikit: Install scikit-image as a simple backend for ray transforms.
proximal: Install the ProxImaL convex optimization package.
testing: Pull in the dependencies for unit tests (see Running the tests)
These dependencies are optional and may not be easy to install on your system (especially on Windows). In general, a clean ODL installation is enough for most users’ initial needs.
More information can be found in Installing ODL extensions.
Running the tests¶
Unit tests in ODL are based on pytest. To run the tests, you first need to install the testing framework:
$ pip install --user odl[testing]
Now you can check that everything was installed properly by running
$ python -c "import odl; odl.test()"
If you have several versions of ODL and run this command in the top-level directory of an ODL clone, the tests in the repository will be run, not the ones in the installed package.