【问题标题】:Error finding custom protobuf plugin查找自定义 protobuf 插件时出错
【发布时间】:2017-06-28 19:01:38
【问题描述】:

当我尝试使用我下载的插件从.proto 文件生成代码时,它可以工作。例如,使用以下作品:

protoc --python_out=. --plugin=protoc-gen-python=$GOPATH/bin/protoc-gen-python ./hello.proto

也是如此

protoc --go_out=. --plugin=protoc-gen-go=$GOPATH/bin/protoc-gen-go ./hello.proto

这些命令会生成适当的存根(几乎可以满足插件的要求)。 但是,以下给出了错误:

protoc --custom_out=. --plugin=protoc-gen-custom=my-plugin.py ./hello.proto

错误只是说

my-plugin.py: program not found or is not executable --custom_out: protoc-gen-custom: Plugin failed with status code 1.

即使my-plugin.py 在我的当前目录中

【问题讨论】:

    标签: python macos protocol-buffers grpc protoc


    【解决方案1】:

    原来我的 python 脚本不是可执行文件;我必须在顶部添加以下内容: #!/usr/bin/env python

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-07-24
      • 2015-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多