--proto_path passed empty directory name
Asked Answered
C

3

5

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?

Collage answered 24/9, 2020 at 14:1 Comment(1)
just write " protoc myfilename.proto "Tegantegmen
G
11

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

Granny answered 15/11, 2020 at 10:47 Comment(0)
P
0

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.

Precision answered 24/9, 2020 at 16:29 Comment(0)
M
0

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=.
Minutia answered 18/11, 2022 at 8:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.