2017-06-28 21 views
1

ダウンロードしたプラグインを使用して.proto個のファイルからコードを生成しようとすると、動作します。たとえば、次のような作品を使用して:カスタムprotobufプラグインの検索中にエラーが発生しました

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が私の現在のディレクトリにあるにもかかわらず

答えて

1

は私のPythonスクリプトは、「wasn判明

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

を語ります実行可能ファイル。私は上に次のものを追加しなければならなかった: #!/usr/bin/env python

関連する問題