安装protoc

I also encountered the same problem!
Does anyone know how to solve it?

google/protobuf/descriptor.proto: File not found. google/api/annotations.proto: Import "google/protobuf/descriptor.proto" was not found or had errors. google/api/annotations.proto:28:8: "google.protobuf.MethodOptions" is not defined. threeapipb.proto: Import "google/api/annotations.proto" was not found or had errors.
your need install protobuf 3 on your system

Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip

Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3

Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/

Move protoc3/include to /usr/local/include/
sudo mv protoc3/include/* /usr/local/include/

Optional: change owner
sudo chown [user] /usr/local/bin/protoc
sudo chown -R [user] /usr/local/include/google
``

posted @ 2021-09-21 16:16  devhg  阅读(110)  评论(0编辑  收藏  举报