In order to set up keyring authentication to a private pip repository, I followed the steps on Setting up authentication to Python package repositories - Authenticating with keyring.
I chose to use an environment variable for the authentication. I verified it was set correctly:
abc@def:~/PycharmProjects/ghi$ echo $GOOGLE_APPLICATION_CREDENTIALS
/home/jkl/.googlekeys/serviceaccount.json
I also logged in my user using gcloud auth login
.
The user that is logged in is the owner of a service account that has write permission on the Artifact Registry.
Unfortunately, I get the following output when trying to install a package:
abc@def:~/PycharmProjects/ghi$ pip install stringcase
Looking in indexes: https://pypi.org/simple, https://us-west1-python.pkg.dev/mno-415182/pqr/simple/
User for us-west1-python.pkg.dev:
I expected the keyring to handle the authentication at this step. Any suggestions for determining the cause of this problem?
Keyring authentication with user credentials
andKeyring authentication with service account credentials
steps of the documentation? If so, this might be the problem, as they are both different methods of the final step in the authentication, the documentation can be a bit misleading on this. So try undoing thegcloud auth login
and let me know if it works. – Gamezgcloud auth revoke
, the problem still persists. – Skywaygcloud auth revoke --all
: it now installs packages using pip from PyPI without prompting for credentials, so maybe authentication goes well! Ultimately, I wanted to publish a package using Poetry, and that still fails (it does still prompt for credentials there). I think I should pose that question in a separate thread as it may be a Poetry issue. – Skyway