# docker version
make pip-compile ARGS="--upgrade"
```

From there you can install the new dependencies, as [described below](#installing-packages).

#### Installing Packages

[Section titled “Installing Packages”](#installing-packages)

If you’re running Python natively, you can install your packages with the following command. Run this after activating your virtual environment:

```bash
pip install -r requirements/requirements.txt
```

In Docker your Python packages are installed at container *build* time. This means that any time you want to change your installed new packages, you have to rebuild your container.

You can do this by running

```bash
docker compose build
```

Confusingly, running `pip install` or `docker compose exec web pip install` does *not* work.

#### The `make requirements` shortcut for Docker

[Section titled “The make requirements shortcut for Docker”](#the-make-requirements-shortcut-for-docker)

Pegasus ships with a convenience target for rebuilding requirements with Docker. Any time you make changes to a `requirements.in` file you can run it with:

```bash
make requirements
```

Behind the scenes this will:

1. Rebuild all your `-requirements.txt` files from your `-requirements.in` files with `uv`.
2. Rebuild your containers (installing the new packages).
3. Restart your containers.

For more information, see the [docker documentation](/docker/#updating-python-packages).