Skip to content

Failing imports for submodules of the google-api-core packages #827

Open
@glaubitz

Description

@glaubitz

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/abuild/rpmbuild/BUILD/python-celery-test-5.5.3-build/celery-5.5.3/t/unit/backends/test_gcs.py'.
[   21s] Hint: make sure your test modules/packages have valid Python names.
[   21s] Traceback:
[   21s] /usr/lib64/python3.11/importlib/__init__.py:126: in import_module
[   21s]     return _bootstrap._gcd_import(name[level:], package, level)
[   21s] t/unit/backends/test_gcs.py:5: in <module>
[   21s]     from google.cloud.exceptions import NotFound
[   21s] E   ModuleNotFoundError: No module named 'google.cloud'
[   21s] =============================== warnings summary ===============================

And indeed that does not work on a test system:

glaubitz@suse-laptop:~> python3
Python 3.13.3 (main, Apr 11 2025, 19:56:42) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import google.cloud
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import google.cloud
ModuleNotFoundError: No module named 'google.cloud'
>>> 
glaubitz@suse-laptop:~> rpm -q python313-google-api-core
python313-google-api-core-2.25.1-0.noarch
glaubitz@suse-laptop:~> ls -ld /usr/lib/python3.13/site-packages/google/cloud
drwxr-xr-x 4 root root 4096 May 14 11:53 /usr/lib/python3.13/site-packages/google/cloud
glaubitz@suse-laptop:~>

It seems that I am missing something here but I'm not sure what.

Any suggestions?

[1] https://build.opensuse.org/package/live_build_log/devel:languages:python/python-celery:test/openSUSE_Tumbleweed/x86_64

Metadata

Metadata

Assignees

Labels

externalThis issue is blocked on a bug with the actual product.priority: p2Moderately-important priority. Fix may not be included in next release.status: blockedResolving the issue is dependent on other work.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions