protoc-wheel-0
raw JSON → 30.2 verified Fri May 01 auth: no python
A Python wheel distribution of the Protocol Buffers compiler (protoc), version 30.2. This package provides the protoc binary as a platform-dependent wheel, allowing easy installation without needing to download from GitHub. It is updated regularly to match protobuf releases.
pip install protoc-wheel-0==30.2 Common errors
error ImportError: No module named protoc ↓
cause Attempting to import 'protoc' in Python code.
fix
protoc is a command-line tool, not a Python module. Use subprocess or shell.
error protoc: error while loading shared libraries: libprotobuf.so.30: cannot open shared object file ↓
cause The protoc binary from the wheel may have dynamic library dependencies not present on the system.
fix
Install the protobuf system library or use a static build. Alternatively, use grpcio-tools which statically links protoc.
error Version mismatch: protoc version 30.2 but protobuf Python package is 4.25.3 ↓
cause Mismatch between protoc and protobuf runtime versions.
fix
Ensure both protoc-wheel-0 and protobuf are the same major.minor version: pip install protobuf==30.2
Warnings
gotcha protoc-wheel-0 provides a protoc binary, not a Python module. Do not attempt to import it in Python code; use subprocess or shell commands. ↓
fix Use subprocess.run(['protoc', ...]) or shell call.
deprecated The protoc-wheel-0 package is a third-party wheel distribution. For official protoc binaries, consider downloading from GitHub releases or using the protobuf compiler included in the grpcio-tools package. ↓
fix Switch to grpcio-tools (which includes protoc) or download official protoc from https://github.com/protocolbuffers/protobuf/releases.
gotcha The version number of protoc-wheel-0 matches the protobuf release version (30.2). Ensure that the protoc version is compatible with the protobuf Python package you are using (e.g., protobuf==30.2). ↓
fix Install matching protobuf: pip install protobuf==30.2
Imports
- main
No Python import; use CLI: protoc
Quickstart
# After installation, protoc is available as a command-line tool.
# Example: generate Python code from .proto file
# Create a sample proto file first: echo 'syntax = "proto3"; message Test { string name = 1; }' > test.proto
import subprocess
subprocess.run(['protoc', '--python_out=.', 'test.proto'], check=True)
print('Generated test_pb2.py')