Skip to content

3.8.3 shipping google/__init__.py breaks google.protobuf #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mh21 opened this issue May 19, 2025 · 0 comments
Open

3.8.3 shipping google/__init__.py breaks google.protobuf #368

mh21 opened this issue May 19, 2025 · 0 comments
Assignees
Labels
bug Something isn't working P1

Comments

@mh21
Copy link

mh21 commented May 19, 2025

reproducer:

$ podman run --rm -it quay.io/fedora/fedora:41
(container) $ dnf install -y python3 python3-pip
(container) $ pip3 install setuptools functions-framework==3.8.2 protobuf
(container) $ python3 -c 'import google.protobuf'  # just works
(container) $ pip3 install setuptools functions-framework==3.8.3 protobuf
(container) $ python3 -c 'import google.protobuf'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
    import google.protobuf
ModuleNotFoundError: No module named 'google.protobuf'
(container) $ rm -f /usr/local/lib/python3.13/site-packages/google/__init__.py
(container) $ python3 -c 'import google.protobuf'  # works again

This seems to be caused by the first branch in src/google/__init__.py, as it works without pkg_resources (from setuptools) installed:

try:
    import pkg_resources

    pkg_resources.declare_namespace(__name__)
except ImportError:
  ...

This might be caused by functions-framework being installed into /usr/local/lib/python3.13/site-packages/, while protobuf is at /usr/local/lib64/python3.13/site-packages/.

@janell-chen janell-chen added bug Something isn't working P1 labels May 19, 2025
@janell-chen janell-chen self-assigned this May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1
Projects
None yet
Development

No branches or pull requests

2 participants