You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用grpc_tools.protoc编译Edition=2023的gRPC失败求助

问题:Python gRPC工具适配Protobuf Editions失败

环境与现状

  • 本地macOS系统,protoc版本:
> protoc --version
libprotoc 28.3
  • 该版本搭配对应插件可正常生成TypeScript、Go、C++的gRPC代码,也能生成普通Protobuf代码:
> protoc --experimental_editions -I src/proto3 --python_out=./src/generated/python/revepb src/proto3/*.proto
  • 但使用grpc_tools生成gRPC代码时失败:
> uv run python3 -m grpc_tools.protoc --experimental_editions -I src/proto3 --python_out=./src/generated/python/revepb src/proto3/*.proto
basetypes.generated.proto: is an editions file, but code generator --python_out hasn't been updated to support editions yet.  Please ask the owner of this code generator to add support or switch back to proto2/proto3.
  • 单独使用--python_out正常,推测grpc_tools自带的protoc未适配Editions。当前依赖版本:
+ grpcio==1.67.1
+ grpcio-tools==1.67.1
+ protobuf==5.28.3
+ setuptools==75.5.0
  • grpcio/grpcio-tools 1.67.1是2024年10月28日发布的最新版本。

疑问与求助

  • 还能检查哪些版本相关内容?
  • 假设Python下使用带Editions的gRPC是主流可用功能,该假设是否错误?
  • 还有哪些解决办法?

内容的提问来源于stack exchange,提问作者Jon Watte

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 07:19:56