查找自定义protobuf插件时出错

2024-04-24 06:14:46 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试使用下载的插件从.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在我当前的目录中


Tags: py插件gohellobinmy错误custom