Gen*_*ius 5 python protocol-buffers proto
我正在尝试使用以下命令编译 proto 文件:
protoc -I=. --python_out=. ./message.proto --proto_path=.
Run Code Online (Sandbox Code Playgroud)
但我收到这个错误:
--proto_path passed empty directory name. (Use "." for current directory.)
Run Code Online (Sandbox Code Playgroud)
该怎么办?
该命令对我有用。
注意
-I==--proto_path所以使用相同的值是多余的
一个“问题”protoc是 protobuf 文件必须由proto_path.
因此,在您的情况下,当前目录必须包含有效message.proto文件,既是./message.proto有效的引用,又因为您--proto_path包含当前目录。