Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

python引入protobuf 文件报错,无法引入文件

这是user的

syntax="proto3";
import "google/protobuf/any.proto";
import "pythonProject/proto/b.proto";
message user{

  int32 adversaryAuthorizationInfo=1;
  b  anchorInfo=2;
  int32  authorizationInfo=3;
  string avatar_url=4;
  string  bg_img_url=5;
  repeated string badge_image_list=6;
  uint64 birthday=7;
  string city=8;
  int64 create_time=9;
  string display_id=10;
  bool with_car_management_permission=11;
  bool with_commerce_permission=12;


}

这是b 的

syntax="proto3";
message b{
  uint64 level=1;
  int64 type=2;
}

image.png

我这样引入protobuf 的包有问题吗?
我import "pythonProject/proto/b.proto"; 这里还是红色的


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...