Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Win10,Goland。protoc-I--外出=插件=grpc:。proto/hello/hello.proto.:权限被拒绝_Go_Protocol Buffers_Grpc_Protoc - Fatal编程技术网

Win10,Goland。protoc-I--外出=插件=grpc:。proto/hello/hello.proto.:权限被拒绝

Win10,Goland。protoc-I--外出=插件=grpc:。proto/hello/hello.proto.:权限被拒绝,go,protocol-buffers,grpc,protoc,Go,Protocol Buffers,Grpc,Protoc,软件环境:Win10,Goland. go版本: go1.9.1 windows/amd64。 protoc--版本: libprotoc 3.5.1 当我执行命令时。 结果如下 protoc -I . --go_out=plugins=grpc: . proto/hello/hello.proto .: Permission denied 我试图以管理员的身份运行。我可以完全控制所有文件。现在我该怎么做。命令的格式似乎不太好。 如上所述,格式如下- protoc-I routeguide

软件环境:Win10,Goland.
go版本: go1.9.1 windows/amd64。 protoc--版本: libprotoc 3.5.1 当我执行命令时。 结果如下

protoc -I . --go_out=plugins=grpc: . proto/hello/hello.proto 
.: Permission denied

我试图以管理员的身份运行。我可以完全控制所有文件。现在我该怎么做。

命令的格式似乎不太好。 如上所述,格式如下-

protoc-I routeguide/routeguide/route\u guide.proto--go\u out=plugins=grpc:routeguide

我也有同样的问题

我发现错误信息具有误导性

以下是对我有效的方法:

更改此项:

protoc -I . --go_out=plugins=grpc: . proto/hello/hello.proto 
为此:

protoc ./proto/hello/hello.proto --go_out=plugins=grpc:./outputDirectory -I ./proto/hello/hello.proto
命令的某些部分看起来显然是多余的,但我必须这样做才能让它正常工作。我建议试试这个,看看它是否运行。如果是这样的话,你可以看看你是否能够调整它,但我不这么认为

您绝对不应该将“proto/hello/hello.proto”作为输出,因为这实际上是您的输入文件。如果输出为“.”,请执行以下操作:

protoc ./proto/hello/hello.proto --go_out=plugins=grpc:. -I ./proto/hello/hello.proto

请注意,您不需要空间。

我真的不知道为什么拒绝许可,但我有一个解决此问题的方法。我的解决方案可能需要时间,但会奏效。尝试将每个protoc文件逐个转换为py文件,如

protoc object_detection/protos/model.proto --python_out=.
我这样解决我的问题


我还收到了Windows中protoc拒绝的权限。我还能够根据@sohaib anwaar的笔记生成单个文件

该批处理脚本通过逐个迭代文件并发出protoc命令,节省了大量键入工作

for %i in (object_detection\protos\*.proto) do protoc object_detection\protos\%~nxi --python_out=.

执行后,将在object\u detection\protos文件夹中找到匹配的*\u pb2.py文件。

对我有效:实际上已经存在的hello.pg.go必须删除,因为即使在授予完全访问权限时,也不允许覆盖它。。。删除hello.pb.go并再次编译.protoc文件后,出现了一个新的.pb.go文件,现在可以被
命令:protoc-I proto/hello/hello.proto--go_out=plugins=grpc:hello

权限仍然被拒绝