> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pyx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing packages

Once [authenticated](./authentication), you can install from pyx by configuring
an index URL.

For example, to install FastAPI from the PyPI proxy, run:

```shell theme={null}
uv pip install fastapi --index https://api.pyx.dev/simple/pypi
```

Or, configure the index in your `pyproject.toml`:

```toml pyproject.toml icon="file" theme={null}
[[tool.uv.index]]
name = "pypi"
url = "https://api.pyx.dev/simple/pypi"
```

Similarly, to use the CUDA 12.6-enabled index, use the corresponding index URL:

```toml pyproject.toml icon="file" theme={null}
[[tool.uv.index]]
name = "cu126"
url = "https://api.pyx.dev/simple/astral-sh/cu126"
```

By default, users have access to the following indexes:

* `public/pypi`
* `astral-sh/cpu`
* `astral-sh/cu130`
* `astral-sh/cu129`
* `astral-sh/cu128`
* `astral-sh/cu126`
* `astral-sh/cu124`
* `astral-sh/cu121`
* `astral-sh/cu118`
* `astral-sh/rocm6.4`
* `astral-sh/rocm6.3`
* `astral-sh/rocm6.2.4`
* `astral-sh/rocm6.2`
* `astral-sh/rocm6.1`
* `astral-sh/rocm6.0`
* `astral-sh/xpu`

Along with an internal index for your team's packages (e.g., `acme/main`).

## pip support

pyx supports installing packages with non-uv clients, like
[pip](https://pip.pypa.io/en/stable/).

To use pyx with `pip`, we recommend installing the
[`pyx-keyring`](https://pypi.org/project/pyx-keyring/) package, which leverages
pip's
[keyring support](https://pip.pypa.io/en/stable/topics/authentication/#keyring-support)
to authenticate requests to pyx.

Specifically, to authenticate pip, install the `pyx-keyring` package into the
virtual environment, then set pip's index URL to the appropriate pyx index:

```shell theme={null}
# Create a virtual environment.
python -m venv .venv
source .venv/bin/activate

# Install keyring and the pyx-keyring plugin.
pip install keyring pyx-keyring

# Install from pyx.
pip install fastapi --index-url https://api.pyx.dev/simple/pypi
```

`pyx-keyring` will authenticate requests via the `PYX_API_KEY` or
`PYX_AUTH_TOKEN` environment variables, if set; otherwise, it will use the `uv`
client to authenticate by invoking `uv auth token pyx.dev`.

<Note>
  If you're using pip in a headless context (e.g., a Databricks notebook), you'll
  need to set pip's `keyring-provider` to `import` explicitly, as the default provider (`auto`)
  will disable keyring in these settings.

  You can configure pip to use the `import` provider by passing
  `--keyring-provider=import` to the `pip install` command, setting the
  `PIP_KEYRING_PROVIDER=import` environment variable, or running
  `pip config set --global global.keyring-provider import`.
</Note>

## Poetry support

pyx supports installing packages with [Poetry](https://python-poetry.org/).

To use pyx with Poetry, configure pyx as a package source in your
`pyproject.toml`. Since pyx serves files from a separate CDN, you'll need to
configure both the API and the CDN as sources:

```toml pyproject.toml icon="file" theme={null}
[[tool.poetry.source]]
name = "pyx"
url = "https://api.pyx.dev/simple/public/pypi"
priority = "primary"

[[tool.poetry.source]]
name = "astralhosted"
url = "https://files.astralhosted.com"
priority = "explicit"
```

Then, authenticate Poetry against both sources:

```shell theme={null}
poetry config http-basic.pyx __token__ $(uv auth token pyx.dev)
poetry config http-basic.astralhosted __token__ $(uv auth token pyx.dev)
```

From there, `poetry install` will install packages from pyx.
