Registry / gcp / googleapis-common-protos

googleapis-common-protos

JSON →
library1.75.2pypypi✓ verified 24d ago

The 'googleapis-common-protos' library provides common protocol buffer types used across various Google APIs. The current version is 1.73.1, released on March 28, 2026. The library is actively maintained with regular updates to ensure compatibility and feature enhancements.

pip install googleapis-common-protos
INSTALL
IMPORT
SIG · GOOGLEAPIS-COMMON-
G
googleapis-common-protos
gcppythonv1.75.2
Install
2.2s avg
Import
180ms
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.75.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.302s · 21MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.058s · 22MB
19MB installed
● package 19MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

error_details_pb2
from google.rpc import error_details_pb2
import google.rpc.error_details_pb2
Direct import may fail; use the 'from' syntax for proper module resolution.

This example demonstrates how to create, serialize, and deserialize a common error detail message using the 'googleapis-common-protos' library.

from google.rpc import error_details_pb2 # Create an instance of a common error detail message detail = error_details_pb2.DebugInfo() detail.detail = 'Detailed error information' # Serialize the message to a string serialized_detail = detail.SerializeToString() # Deserialize the string back to a message new_detail = error_details_pb2.DebugInfo() new_detail.ParseFromString(serialized_detail) print(new_detail.detail)
Debug
Known issues
breakingVersion 1.67.0 removed .proto files from wheels, causing issues for users relying on these files for building Python Protobuf bindings.
fix
Pin to 'googleapis-common-protos<1.67.0' or ensure that your build process does not depend on the presence of .proto files in the package.
affects: 1.67.0
breakingIncompatibility with 'protobuf' versions 4.21.5 and above, leading to import errors in dependent packages.
fix
Downgrade 'protobuf' to a version below 4.21.5 to maintain compatibility.
affects: protobuf>=4.21.5
gotchaImporting modules directly without the 'from' syntax may lead to import errors due to module resolution issues.
fix
Use the 'from' syntax for imports, e.g., 'from google.rpc import error_details_pb2'.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'google.protobuf'
The `protobuf` library, which `googleapis-common-protos` depends on for serialization and deserialization of structured data, is not installed or not correctly recognized in your Python environment.
fix
Install the `protobuf` package: `pip install protobuf` (or `pip install googleapis-common-protos` which will install `protobuf` as a dependency). Consider using a virtual environment.
ImportError: cannot import name 'descriptor_pb2'
This error typically occurs when the `protobuf` runtime library's generated Python files (`_pb2.py`), including `descriptor_pb2.py`, are either not properly built, corrupted, or cannot be found by Python, often due to an incomplete or problematic `protobuf` installation or a namespace conflict.
fix
Ensure `protobuf` is correctly installed. It often helps to reinstall both packages in a clean virtual environment: `pip uninstall protobuf googleapis-common-protos` followed by `pip install googleapis-common-protos`.
ModuleNotFoundError: No module named 'google.api'
This specific import error, particularly when trying to import a `_pb2` file (e.g., `distribution_pb2`) from `google.api`, can arise from version conflicts between `googleapis-common-protos` (especially versions 1.62 or later) and older `protobuf` versions, or when installing with `setup.py` instead of `pip`, which can interfere with proper namespace package creation.
fix
Ensure both `googleapis-common-protos` and `protobuf` are up-to-date and installed using `pip` to resolve potential namespace issues: `pip install --upgrade googleapis-common-protos protobuf`.
Import "google/api/annotations.proto" was not found or had errors.
When using `protoc` (the Protocol Buffer compiler) to compile your `.proto` files that import common Google API protos (like `google/api/annotations.proto`), `protoc` cannot locate the necessary `.proto` source files. This can happen if the `googleapis-common-protos` Python package was installed without its `.proto` files (an issue in some older versions) or if the `--proto_path` argument is not correctly configured to point to the directory containing these Google API `.proto` definitions.
fix
You need to provide `protoc` with the path to the `google/api` `.proto` files. This often involves obtaining the `googleapis` repository (e.g., from GitHub) and including its path: `protoc -I. -I/path/to/downloaded/googleapis --python_out=. my_service.proto` (where `/path/to/downloaded/googleapis` contains the `google/api` directory).
Upgrade
Version history
1.75.2latest on PyPI · released Aug 25, 2026
Audit
Dependencies
protobufrequiredRequired for protocol buffer support
Agent activity
28 hits · last 30 days
node
22
OpenAI (training)
2
Resources
googleapis-common-protos — pip install googleapis-common-protos · libregistry