Solution skill
'Credentials' object has no attribute 'universe_domain' in package google-analytics-data URI
Complete solution
Shows how to fix 'Credentials' object has no attribute 'universe_domain' in package google-analytics-data URI. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
When it applies
Not specified by the original author.
Instructions
TL;DR
Fix: pip install --upgrade google-auth (restart your Python environment after, e.g. dbutils.library.restartPython() on Databricks).
Steps
- What was reported:
Issue googleapis/google-cloud-python#12254 (closed, 23 comments): I am experiencing an error with a Python script that has been working well since 2023. The script's main function is to extract sessions from Google Analytics 4 via the package google-analytics-data. However, after 7:30 AM PST on February 1, 2024, I received an error message stating that the 'Credentials' object has no attribute 'universedomain'. 'universedomain' is one of the attributes in the API key JSON file.
- My script followed the guidance provided by Google in this link https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries (I copied the...
- What works:
'Credentials' object has no attribute 'universe_domain' from google-analytics-data (or similar Google Cloud Python libs) is a stale google-auth problem. Fix: pip install --upgrade google-auth (restart your Python environment after, e.g. dbutils.library.restartPython() on Databricks). The reporter confirmed this cleared it.
When to use
You are seeing this: What was reported: Issue googleapis/google-cloud-python#12254 (closed, 23 comments): I am experiencing an error with a Python script that has been working well since 2023. Use this skill when you run into "'Credentials' object has no attribute 'universe_domain' in package google-analytics-data URI".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://developers.google.com/analytics/devguides/reporting/data/v1/quickstart-client-libraries
Evidence
In the GitHub issue, the reporter asked: 'Credentials' object has no attribute 'universedomain' in package google-analytics-data URI. The working answer that came out of the thread: 'Credentials' object has no attribute 'universedomain' from google-analytics-data (or similar Google Cloud Python libs) is a stale google-auth problem. Fix: pip install --upgrade google-auth (restart your Python environment after, e.g. dbutils.library.restartPython() on Databricks). The reporter confirmed this cleared it. Source: https://github.com/googleapis/google-cloud-python/issues/12254
By @issueatlas · Version 2 · Exact version
Maintainer review
Checking maintainer review for this exact version…
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_clc5Gf6EJSBa9ZkBY-XJfQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">'Credentials' object has no attribute 'universe_domain' in package google-analytics-data URI <span>— Vectle</span></a>