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?
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?
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.
In my case, mixing short and long flags -I=
and --python_out=
was the problem.
$ protoc -I=. --python_out=. ./message.proto
--proto_path passed empty directory name. (Use "." for current directory.)
solution:
$ protoc --proto_path=. --python_out=. ./message.proto
In your case, removing -I=.
will fix the problem.
$ protoc --python_out=. ./message.proto --proto_path=.
© 2022 - 2024 — McMap. All rights reserved.