3

When I try to generate code from .proto files using plugins I've downloaded, it works. For example, using the following works:

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

and so does

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

These commands generate proper stubs (pretty much does what the plugin wants them to do). However, the following gives an error:

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

The error simply says

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

even though my-plugin.py is in my current directory

1 Answer 1

2

Turns out my python script wasn't an executable; I had to add the following to the top: #!/usr/bin/env python

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.