This repository builds and publishes prebuilt versions of the
protoc-gen-grpc-python plugin, addressing gRPC issue #26125 where the plugin is not
distributed with grpcio-tools.
The gRPC Python plugin (grpc_python_plugin) is not available as a prebuilt binary, forcing users to either:
- Build it from source
- Use non-standard Python-specific code generation instead of protoc plugins
This makes it impossible for tools like buf to (locally) generate Python
gRPC code, as they require protoc plugins.
- Go to the Releases page
- Download the appropriate binary for your platform and gRPC version
- Make it executable:
chmod +x protoc-gen-grpc-python - Place it in your PATH or specify its location to protoc
protoc --plugin=protoc-gen-grpc-python=/path/to/protoc-gen-grpc-python \
--grpc-python_out=. \
your_service.protoAdd to your buf.gen.yaml:
version: v1
plugins:
- name: python
out: gen
- name: grpc-python
path: /path/to/protoc-gen-grpc-python
out: gen- Linux x86_64 (amd64)
- Linux aarch64 (arm64)
- macOS x86_64 (Intel)
- macOS arm64 (Apple Silicon)
Windows is currently not supported due to the grpc repository having filenames that are too long for Windows.
See the Releases page for available versions.
You can test the build process locally using act.
# Test the build workflow
act pushFeel free to open issues or pull requests to:
- Add support for additional platforms
- Request specific gRPC versions
- Report bugs or issues with the prebuilt binaries
This repository's build scripts are licensed under MIT.
The protoc-gen-grpc-python binary is built from gRPC source code and is subject to the Apache 2.0 license.