Skip to content

Pixi Repositories

Pixi installs conda packages from conda channels and Python packages from a PyPI-compatible index. A CloudRepo Python repository is a PyPI-compatible index, so Pixi reads your private Python packages from it. Keep a channels line in pixi.toml pointing at the channel’s own host; CloudRepo hosts Python repositories, not conda channels.

  • A Python repository to install from. Creating a Repository explains how to make one.
  • A repository token that covers it. Download packages is enough to install; publishing takes Download and publish packages. Repository Tokens shows how to create one. In .netrc, login is the email address that owns the token and password is the token.
  • The index address, https://your-org.mycloudrepo.io/repositories/your-repo/simple/. The repository’s Connection Settings page shows the URL with your organization and repository filled in. Add /simple/ to the end.
  • Pixi. The behavior described on this page was observed with Pixi 0.81.0.

Used on this page only, never saved. Never enter a token or password here.

1. Put the credential in ~/.netrc. Pixi reads it for any Python index host it finds there. Keep the file private to your own user (chmod 600 ~/.netrc):

~/.netrc
machine your-org.mycloudrepo.io
login you@example.com
password YOUR_REPOSITORY_TOKEN

2. Name the index in pixi.toml. Give each private package its own index. A package that names an index is looked up on that index, not on PyPI:

pixi.toml
[pypi-dependencies]
my-package = { version = "==1.0.0", index = "https://your-org.mycloudrepo.io/repositories/your-repo/simple/" }

The same entry from the command line:

Terminal
pixi add --pypi "my-package==1.0.0" --index https://your-org.mycloudrepo.io/repositories/your-repo/simple/

3. Install. Run this in the same directory as pixi.toml:

Terminal
pixi install

Expected: Pixi solves the environment and installs my-package from your repository.

Pixi also reads the netrc named by the NETRC environment variable. Keep the token in the platform’s secret store, expose it to the step as CLOUDREPO_TOKEN (and your email as CLOUDREPO_USERNAME), write the netrc into a private temporary directory, point NETRC at it, and delete the directory when the step ends:

Terminal
umask 077
NETRC_DIR="$(mktemp -d)"
trap 'rm -rf "$NETRC_DIR"' EXIT
echo "machine your-org.mycloudrepo.io login $CLOUDREPO_USERNAME password $CLOUDREPO_TOKEN" > "$NETRC_DIR/netrc"
export NETRC="$NETRC_DIR/netrc"
pixi install

The token is in the file and in the environment, never on a command line, and the file is gone when the step exits, so it does not stay behind on a runner that later jobs reuse. For how each CI system holds a secret, see CI/CD.

Because my-package was not found in the package registry and you require my-package==1.0.0. Pixi prints the same sentence when the package is missing and when the index answers 401 Unauthorized, so a package you know is published usually means the credential did not arrive. Check, in order:

  1. ~/.netrc (or the file NETRC names) has a machine line that is exactly your-org.mycloudrepo.io, with no https:// and no path.
  2. login is the email address that owns the token, password is the token itself rather than your portal password, and the token has not expired or been revoked.
  3. The index URL is https://your-org.mycloudrepo.io/repositories/your-repo/simple/ with your repository’s name.

If those hold, test the credential on its own with the steps in Troubleshooting.

The package is in the repository and the token is right, but the repository is a different one. A token reaches only the repositories it was created for. 403 Forbidden with scope_mismatch_repo means the token does not include this repository. See scope_mismatch_repo.

View as Markdown