当我尝试使用下载的插件从.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脚本不是可执行的;我必须在顶部添加以下内容:
#!/usr/bin/env python
相关问题 更多 >
编程相关推荐