-
Notifications
You must be signed in to change notification settings - Fork 16k
Description
What version of protobuf and what language are you using?
Version: 4.21.0rc1
Language: Python
What operating system (Linux, Windows, ...) and version?
Ubuntu 20.04.4 LTS
What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.9.12
python -m grpc_tools.protoc --version
libprotoc 3.19.4
What did you do?
Steps to reproduce the behavior:
- Run
pip install googleapis-common-protos - In python shell, run
>>> from google.rpc import error_details_pb2 - Observe that no error occurs
- Run
pip install protobuf==4.21.0rc1to install the pre-release version of protobuf - In python shell, run
>>> from google.rpc import error_details_pb2 - Observe the following error
>>> from google.rpc import error_details_pb2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/google/rpc/error_details_pb2.py", line 52, in <module>
_descriptor.FieldDescriptor(
File "/usr/local/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 560, in __new__
_message.Message._CheckCalledFromGeneratedFile()
AttributeError: module 'google._upb._message' has no attribute 'Message'. Did you mean: 'CMessage'?
- Install
grpcio-tools==1.44.0or newer - In python shell, run
>>> from google.rpc import error_details_pb2 - Observe that no error occurs
- Uninstall
grpcio-tools - In python shell, run
>>> from google.rpc import error_details_pb2 - Observe that no error occurs
What did you expect to see
I expected to run from google.rpc import error_details_pb2 in a python shell successfully after installing both googleapis-common-protos and protobuf==4.21.0rc1
What did you see instead?
I saw this error
>>> from google.rpc import error_details_pb2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/google/rpc/error_details_pb2.py", line 52, in <module>
_descriptor.FieldDescriptor(
File "/usr/local/lib/python3.9/site-packages/google/protobuf/descriptor.py", line 560, in __new__
_message.Message._CheckCalledFromGeneratedFile()
AttributeError: module 'google._upb._message' has no attribute 'Message'. Did you mean: 'CMessage'?
The strange thing is that installing grpcio-tools solved the issue, however removing grpcio-tools did not bring the issue back.
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
Anything else we should know about your project / environment
I used a clean environment for testing, only installing googleapis-common-protos and protobuf==4.21.0rc1