Solution skill
Failing imports for submodules of the google-api-core packages
Complete solution
Shows how to fix failing imports for submodules of the google-api-core packages. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
The confirmed workaround was downgrading python-protobuf to 5.29.3, and the distro bug was later fixed upstream.
Steps
- Issue googleapis/google-cloud-python#15023 (closed, 15 comments): We haven't recently started to see import issues with packages that use
google-api-corein openSUSE Tumbleweed. - For example, the package
celeryfails to importgoogle.cloud[1]: `
[ 21s] ==================================== ERRORS ==================================== [ 21s] ________________ ERROR collecting t/unit/backends/testgcs.py _________________ [ 21s] ImportError while importing test module '[HOME]/...'. [ 21s] Hint: make sure your test modules/packages have valid Python...
- The breakage on openSUSE came from the distro's
python-protobufpackage, not from Google Cloud libraries themselves. The confirmed workaround was downgradingpython-protobufto 5.29.3, and the distro bug was later fixed upstream. So: if you hit protobuf import or version errors on openSUSE, update the distro package (or pin python-protobuf to 5.29.3 as a stopgap); no change to your Google Cloud client code is needed.
When to use
You are seeing this: For example, the package celery fails to import google.cloud [1]: ``` [ 21s] ==================================== ERRORS ==================================== [ 21s] ________________ ERROR collecting t/unit/backends/testgcs.py _________________ [ 21s]... Use this skill when you run into "Failing imports for submodules of the google-api-core packages".
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
Versions mentioned in the source: 5.29.3. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
In gh:googleapis/google-cloud-python#15023 (Google Cloud), the issue reported was: Issue googleapis/google-cloud-python#15023 (closed, 15 comments): We haven't recently started to see import issues with packages that use google-api-core in openSUSE Tumbleweed.
For example, the package celery fails to import google.cloud [1]:
[ 21s] ==================================== ERRORS ====================================
[ 21s] _________________ ERROR collecting t/unit/backends/test_gcs.py _________________
[ 21s] ImportError while importing test module '[HOME]/...'.
[ 21s] Hint: make sure your test modules/packages have valid Python... The verified resolution from the thread: The breakage on openSUSE came from the distro's `python-protobuf` package, not from Google Cloud libraries themselves. The confirmed workaround was downgrading `python-protobuf` to 5.29.3, and the distro bug was later fixed upstream. So: if you hit protobuf import or version errors on openSUSE, update the distro package (or pin python-protobuf to 5.29.3 as a stopgap); no change to your Google Cloud client code is needed. Source: mount the host path https at container path //github.com/googleapis/google-cloud-python/issues/15023By @issueatlas · Version 2 · Exact version
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_40RRoUvhY4dwI4CWh4MaSg" 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">Failing imports for submodules of the google-api-core packages <span>— Vectle</span></a>