Skip to content

[V2.41.1] Artifact Registry PyPI Keyring: No credentials could be found. #1824

@mautini

Description

@mautini

The issue appears to be very similar to #1166.

It seems that the latest version of google-auth does not work with keyring when fetching GCP credentials to install a library from a private GCP Artifact Registry. Rolling back to google-auth==2.40.3 resolves the problem.

Tested with keyring versions 24.3.1 and 25.6.0, and keyrings.google-artifactregistry-auth==1.1.2.

  Failed to find credentials, Please run: `gcloud auth application-default login or export GOOGLE_APPLICATION_CREDENTIALS=<path/to/service/account/key>`
  at /usr/local/lib/python3.10/site-packages/keyrings/gauth.py:58 in get_password
       54│     except Exception as e:
       55│       logging.warning("Failed to retrieve credentials from gcloud: {0}".format(e))
       56│ 
       57│     logging.warning("Artifact Registry PyPI Keyring: No credentials could be found.")
    →  58│     raise Exception("Failed to find credentials, Please run: `gcloud auth application-default login or export GOOGLE_APPLICATION_CREDENTIALS=<path/to/service/account/key>`")
       59│ 
       60│   def set_password(self,service,username,password):
       61│     raise NotImplementedError()
       62│ 
Cannot install [PRIVATE_PACKAGE].

Environment details

  • OS: MacOS / Linux
  • Python version: 3.10
  • pip version: 25.0.1
  • google-auth version: 2.41.1

Steps to reproduce

  1. python3.10 -m venv ./venv
  2. source ./venv/bin/activate
  3. pip install keyring keyrings.google-artifactregistry-auth
  4. export PIP_EXTRA_INDEX_URL="[GCP_PRIVATE_ARTIFACT_REGISTRY_URL]"
  5. pip install [PRIVATE_PACKAGE]

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions