# Installing Python libraries

Python packages from PyPI or your own index, installed through the Dashboard or Docker mounts.

You can add any Python libraries to Zato. They can be installed from [PyPI](https://pypi.org/), or your own package index, if you use one.

This includes the Python SDKs of external platforms, such as Firebase, Stripe or Twilio. Once installed, your services import them as any other library.

**Dashboard**

## Overview {#overview}

The dashboard provides a convenient way to install Python packages directly from the web interface without command-line access.

Navigate to **Settings → Python packages** to access the package installation screen.

## Installing packages {#installing-packages}

- Enter your package requirements in the textarea, one package name per line
- Optionally, each package can be given a version specifier

Example requirements:

```text
atlassian-python-api
azure-storage-blob==12.28.0
```

## Testing packages {#testing-packages}

- Before installing, you can verify that packages exist on PyPI by clicking the **Test** button
- Packages from custom indexes or git repositories will be skipped during testing
- Each package will show its status - whether it was found on PyPI or not

## Saving and installing {#saving-and-installing}

- Click the **Save** button to install the packages
- After installation completes, all Zato components (scheduler, server, proxy, dashboard) will be restarted automatically to load the new packages

## Custom package indexes {#custom-package-indexes}

To install packages from a custom index, add the index URL at the top of your requirements using the `--extra-index-url` directive:

```text
--extra-index-url https://my-index.example.com/simple/
atlassian-python-api
my-private-package==1.0.0
```

You can also use `--index-url` to replace the default PyPI index entirely:

```text
--index-url https://my-index.example.com/simple/
my-private-package==1.0.0
```

**DevOps and automation**

For automated deployments, Python packages can be installed via Docker volume mounts.

- Mount a requirements.txt file from host to `/opt/hot-deploy/python-reqs/requirements.txt` inside the container
- Packages will be installed automatically when the container starts
- If the file does not exist or is empty, no dependencies will be installed

Example requirements.txt file:

```text
atlassian-python-api==4.0.7
azure-storage-blob==12.28.0
```

Docker command with the mount (note the highlighted line):

```bash
sudo docker run --pull=always -it --rm -p 22022:22 -p 8183:8183 -p 11223:11223 \
  --mount type=bind,source=/my/reqs.txt,target=/opt/hot-deploy/python-reqs/requirements.txt \
  --name zato-4.1 zatosource/zato-4.1
```

## Installing without internet access {#installing-without-internet-access}

In networks without access to PyPI, packages are installed from wheel files. Mount a directory with the wheels, e.g. `/my/wheels` to `/opt/hot-deploy/python-reqs/wheels`, and add two lines at the top of your requirements:

```text
--no-index
--find-links /opt/hot-deploy/python-reqs/wheels
atlassian-python-api==4.0.7
```

To obtain the wheels, run `pip download -r requirements.txt -d wheels` in a Zato container on a system with internet access, which produces wheels built for the same platform, and transfer the directory to the target system.
