--proto_path passed empty directory name

Viewed 5370

I'm trying to compile a proto file with the following command:

protoc -I=. --python_out=. ./message.proto --proto_path=.

But I'm getting this error:

--proto_path passed empty directory name.  (Use "." for current directory.)

What to do?

2 Answers

You should remove = in -I=. and also remove --proto_path=. flag

The command works for me.

NOTE -I == --proto_path so using both with the same value is redundant

One 'wrinkle' with protoc is that the protobuf files must be encapsulated by a proto_path.

So, in your case, the current directory must contain a valid message.proto file, both for ./message.proto to be a valid reference and because your --proto_path includes the current directory.

Related