Protocol buffers protoc与grpc_python_插件:google/protobuf/any.proto:未找到文件
我正在运行以下命令:Protocol buffers protoc与grpc_python_插件:google/protobuf/any.proto:未找到文件,protocol-buffers,Protocol Buffers,我正在运行以下命令: protoc protobuf/file.proto --proto_path=protobuf --proto_path=protobuf --python_out=out/builtin_pb --grpc_out=out/builtin_pb --plugin=protoc-gen-grpc=/usr/local/bin/grpc_python_plugin 其中file.proto具有: syntax = "proto3"; import "google/pro
protoc protobuf/file.proto --proto_path=protobuf --proto_path=protobuf --python_out=out/builtin_pb --grpc_out=out/builtin_pb --plugin=protoc-gen-grpc=/usr/local/bin/grpc_python_plugin
其中file.proto具有:
syntax = "proto3";
import "google/protobuf/any.proto";
比如:
google.protobuf.Any arg = 3;
但是,它有一个错误:
google/protobuf/any.proto: File not found.
bess_msg.proto: Import "google/protobuf/any.proto" was not found or had errors.
bess_msg.proto:251:3: "google.protobuf.Any" is not defined
...
是否有任何步骤可以确保any.proto正确安装
谢谢我最近遇到了这个问题,并意识到我正在使用protobuf 3.0。只需将protobuf编译器升级到最新版本(在我的例子中是3.6)即可获得这些类型的定义。我最近遇到了这个问题,并意识到我正在使用protobuf 3.0。只需将protobuf编译器升级到最新版本(在我的例子中是3.6)即可获得这些类型的定义。我在Ubuntu上尝试将protobuf编译为python时遇到了这个错误。我的问题是,我使用
sudo-apt-install-protobuf-compiler
安装了编译器,但我没有使用sudo-apt-install-libprotobuf-dev
安装资源
感谢您向我展示了我的错误方法。我在Ubuntu上尝试将protobuf编译成python时遇到了这个错误。我的问题是,我使用
sudo-apt-install-protobuf-compiler
安装了编译器,但我没有使用sudo-apt-install-libprotobuf-dev
安装资源
谢谢你告诉我我的错误