Installation with conda#

Install#

Installation via a conda environment circumvents compatibility issues when installing certain libraries. This guide assumes you have a working installation of conda.

First, update conda:

conda update -n base -c defaults conda

First, create a conda environment (we name this autolens to signify it is for the PyAutoLens install):

The command below creates this environment with some of the bigger package requirements, the rest will be installed with PyAutoFit via pip:

conda create -n autolens numba astropy scikit-image scikit-learn scipy

Activate the conda environment (you will have to do this every time you want to run PyAutoLens):

conda activate autolens

We upgrade pip to ensure certain libraries install:

pip install --upgrade pip

The latest version of PyAutoLens is installed via pip as follows (specifying the version as shown below ensures the installation has clean dependencies):

pip install autolens==2022.05.02.1

You may get warnings which state something like:

ERROR: autoarray 2022.2.14.1 has requirement numpy<=1.22.1, but you'll have numpy 1.22.2 which is incompatible.
ERROR: numba 0.53.1 has requirement llvmlite<0.37,>=0.36.0rc1, but you'll have llvmlite 0.38.0 which is incompatible.

If you see these messages, they do not mean that the installation has failed and the instructions below will identify clearly if the installation is a success.

If there are no errors (but only the warnings above) PyAutoLens is installed!

If there is an error check out the troubleshooting section.

Workspace#

Next, clone the autolens workspace (the line --depth 1 clones only the most recent branch on the autolens_workspace, reducing the download size):

cd /path/on/your/computer/you/want/to/put/the/autolens_workspace
git clone https://github.com/Jammy2211/autolens_workspace --depth 1
cd autolens_workspace

Run the welcome.py script to get started!

python3 welcome.py

It should be clear that PyAutoLens runs without issue.

If there is an error check out the troubleshooting section.

Optional#

For interferometer analysis there are two optional dependencies that must be installed via the commands:

pip install pynufft==2020.2.7
pip install pylops==1.11.1

PyAutoLens will run without these libraries and it is recommended that you only install them if you intend to do interferometer analysis.

If you run interferometer code a message explaining that you need to install these libraries will be printed, therefore it is safe not to install them initially.