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

Next, create a conda environment (we name this autogalaxy to signify it is for the PyAutoGalaxy install):

The command below creates this environment with Python 3.12:

conda create -n autogalaxy python=3.12

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

conda activate autogalaxy

We upgrade pip to ensure certain libraries install:

pip install --upgrade pip

The latest version of PyAutoGalaxy is installed via pip as follows (the command --no-cache-dir prevents caching issues impacting the installation):

pip install autogalaxy --no-cache-dir

If pip prints warnings about dependency version conflicts, these can usually be ignored — the instructions below will identify clearly if the installation is a success.

If there are no errors PyAutoGalaxy is installed!

If there is an error check out the troubleshooting section.

Workspace#

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

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

Run the welcome.py script to get started!

python3 welcome.py

It should be clear that PyAutoGalaxy runs without issue.

If there is an error check out the troubleshooting section.

Numba#

Numba (https://numba.pydata.org) is an optional library which makes PyAutoGalaxy run a lot faster, which we strongly recommend users have installed.

You can install numba via the following command:

pip install numba --no-cache-dir

Some users have experienced difficulties installing numba, which is why it is an optional library. If your installation is not successful, you can use PyAutoGalaxy 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 PyAutoGalaxy 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

Optional#

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

pip install pynufft

PyAutoGalaxy 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.