Installation with pip#


We strongly recommend that you install PyAutoLens in a Python virtual environment, with the link attached describing what a virtual environment is and how to create one.

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

You may get warnings which state something like:

ERROR: autoarray 2024.1.27.4 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.


Numba ( is an optional library which makes PyAutoLens run a lot faster, which we strongly recommend users have installed.

You can install numba via the following command:

pip install numba

Some users have experienced difficulties installing numba, which is why it is an optional library. If your installation is not successful, you can use PyAutoLens without it installed for now, to familiarize yourself with the software and determine if it is the right software for you.

If you decide that PyAutoLens is the right software, then I recommend you commit the time to getting a successful numba install working, with more information provided at this readthedocs page


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 --depth 1
cd autolens_workspace

Run the script to get started!


It should be clear that PyAutoLens runs without issue.

If there is an error check out the troubleshooting section.


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

pip install pynufft
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.