Имя protoc не распознано как имя командлета
Перейти к содержимому

Имя protoc не распознано как имя командлета

  • автор:

 

protoc : термин «проток» не распознается как имя командлета, функции, файла сценария или исполняемой программы.

Я пытаюсь установить tensorflow для обнаружения объектов с помощью anaconda и python, и мне нужно использовать protoc для некоторых вещей, но я продолжаю получать сообщение об ошибке при попытке запустить команду protoc \object_detection/protos/*.proto —python_out=. , но я продолжаю получать сообщение об ошибке

Я пытался использовать «` ‘.\protoc’, как предлагает анаконда, но все еще ничего не получил. Кто-нибудь знает, почему он это делает? у меня последняя версия anacond с использованием python 3.7 и protoc 3.14

Cannot find `protoc` command

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

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:

and it works for me.

I typed the command again

But it still fails and this:

m.mera's user avatar

9 Answers 9

The way I solved the issue on Windows 10 was to

  1. copy the protoc file https://github.com/protocolbuffers/protobuf/releases/download/v3.12.4/protoc-3.12.4-win64.zip from the link https://github.com/protocolbuffers/protobuf/releases
  2. Extract the contents of the zip file.
  3. Bin directory contains the protoc.exe
  4. Update the environment variable to point to the bin directory that contains the protoc.exe
  5. Re-Open the cmd as the environment variable take effect only on new command window
  6. run protoc object_detection/protos/*.proto —python_out=.

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.

ReinstateMonica3167040's user avatar

Go to this page to find the downloadable files for the latest version of Protobuf: https://www.github.com/google/protobuf/releases/latest

Then, just download the zip file beginning with protoc for your OS.

Next, extract it, and you will get a protoc application.

Finally, you can place it on your local machine.

ReinstateMonica3167040's user avatar

Kumar S's user avatar

First, make sure that you have protobuf >=3 installed on your system.

On Windos protobuf is usually installed through your Python package manager, e.g. conda or pip, and should already be in your environment. You can check if it is installed with either conda list or pip freeze .

If it is not installed, simply run

conda install protobuf or pip install protobuf

Maryam Bahrami's user avatar

  1. when you download the .zip from https://github.com/protocolbuffers/protobuf/releases, make sure you’re getting the correct file for your OS.
  2. for Windows, in environment variables, you need to add the folder that contains protoc.exe , so in my case C:\Program Files\GoogleProtobuf\bin

That got it working for me.

 

ron_g's user avatar

I also encountered this error a while ago To go around this: Follow the steps listed below:

Install the protoc which is applicable for your operating system from this github repo for me it was
protoc-3.13.0-win64.zip

Extract the zip file and put it in a folder where it will be permanently there

Go to the bin folder present in the protocFolder in my case I had to go to
F:\Programing_stuff\ML\protoc-3.17.3-win64\bin or just find where the protoc.exe file is and copy the path

Then in the windows search bar type path and click on Edit the system environment variables

And the path of the bin folder

Hope this helps, If doesn’t check this video Or this website (If you want to install TensorFlow)

Prathamesh Bhatkar's user avatar

My solution for windows:

  • Download protoc-3.18.0-win64.zip from here
  • Extract zip and Copy proto.exe from bin directory and paste it in models/research folder
  • Then run this command protoc object_detection/protos/*.proto —python_out=.

Depending on your platform, you might have to install protobuf locally. See the docs for more detailed instructions.

First of all consider installing Protobuf Compiler inside the C:\Program Files folder. Then you need to compile protobuf every time you want to use Tensorflow Object Detection API. To do this, open cmd in the ../models/research directory and run

“C:\Program Files\protoc-<PROTO_VERSION>\bin\protoc.exe” object_detection/protos/*.proto —python_out=.

where <PROTO_VERSION> is the version of protobuf compiler, you’re using (for example protoc-3.5.1-win64 or the name of the folder you’ve picked for the protobuf).

Be advised, that you should compile protobuf in the every cmd window that is launched to work with Object Detection.

protoc не распознается как внутренняя или внешняя команда, работающая программа или командный файл Windows

Я пытаюсь скомпилировать библиотеку в определенную папку, выполнив команду:

В командной строке в том месте, где я хочу вызвать команду, я получаю сообщение об ошибке:

Теперь я знаю, что это очень простой вопрос, но я новичок и плохо разбираюсь в ОС или командной строке. Ошибка возникает всякий раз, когда в командной строке есть пробел. Я видел, как многие люди указывают, что они заходят в свойства вашей системы и редактируют системные переменные, но я не понимаю, что редактирование нового пути исправит это.

Любая помощь будет принята с благодарностью.

Ответы (2)

Я думаю, это потому, что вы не настраивали системное окружение. Вы должны добавить папку bin, которая находится в папке protoc, к пути в системной среде. т.е.

What I Broke – Programming and Web Development

Let's take a look at what I've broken today

“‘protoc-gen-go’ is not recognized as an internal or external command” – Go

I’m currently looking into Go and have hit the following error while trying to run proto:

`protoc-gen-go` is not recognized as an internal or external command

I am using Windows and have installed the required libraries:

In my case the issue turned out to be that proto-gen hadn’t been added to my path: E:\repos\gocode\bin

Note that the new path won’t be available until you restart your terminal.

 

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *