Cannot find `protoc` command

m.mera picture m.mera · Oct 22, 2018 · Viewed 25.9k times · Source

When I run this:

protoc --python_out=. .\object_detection\protos\anchor_generator.proto

on a tensorflow object detection file on the command line, I get:

'protoc' is not recognized as an internal or external command, operable program or batch file.

I followed all instructions in protoc object_detection/protos/*.proto: No such file or directory, but they never worked for me

In addition to the searches I made, I tried this command:

py-3.6 -m pip install protobuf

and it works for me.

I typed the command again

python_out=. .\object_detection\protos\anchor_generator.proto 

But it still fails and this:

C:\Users\laptop market\Downloads\bin\protoc object_detection/protos/*.proto --py_out=.

also fails.

Answer

Diwakar Patel picture Diwakar Patel · Jan 29, 2019

You need to save the protoc.exe file which is located in the zip file to C:\Users\Satyarth\AppData\Local\Programs\Python\Python36\Scripts.

Replace "Satyarth" from the path with your username.

If it still isn't working, put the above path in the environment variables.