I've been searching #1053 and #3453 searching, finally I am here. When trying to $ make build
I get the error:
protoc -I . speak.proto --go_out=plugins=grpc:. protoc-gen-go: program not found or is not executable Please specify a program using absolute path or make sure the program is available in your PATH system variable --go_out: protoc-gen-go: Plugin failed with status code 1. make: *** [build] Error 1
I have tried following and installing and going on and on but can't seem to get this error to go away. my make file is:
build:
protoc -I . speak.proto --go_out=plugins=grpc:.
I have tried installing with
go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
and my paths look like
export GOPATH=$HOME/Documents/goworkspace
export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:/usr/local/go/bin
I'm not sure if that's correct as there have been so many conflicting responses as to how it should be set.
What else am I missing? I have sourced my .zshrc
, restarted my terminal, and restarted my laptop but to no avail
Comment From: dsnet
Executing go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
installs protoc-gen-go-grpc
, not protoc-gen-go
.
Perhaps you need go install google.golang.org/protobuf/cmd/protoc-gen-go
as well?
The error clearly indicates protoc-gen-go
as the missing binary, not protoc-gen-go-grpc
.
Comment From: ctfrancia
thanks for the reply!
I was looking at that, and there have been very recent changes to the protobuf package. I have looked at the error and have about 20 tabs open with the same issue and 20 different tabs saying 20 different things. I have already go get google.golang.org/grpc/cmd/protoc-gen-go-grpc
as well as done go install google.golang.org/protobuf/cmd/protoc-gen-go
same issue persists
Comment From: dsnet
If you already ran go install google.golang.org/protobuf/cmd/protoc-gen-go
and protoc
still can't find the command, then the issues likely due to the PATH
environment variable not set up.
Are you certain that your PATH
environment variable contains the directory where go install
outputs the binary?
Comment From: ctfrancia
I am pretty sure, my PATH
Environment is:
export GOPATH=$HOME/Documents/goworkspace
#export PATH=$PATH:$HOME/go/bin
export PATH=$PATH:/usr/local/go/bin
# export PATH=${HOME}/go/bin/protoc-gen-go
If I uncomment export PATH=${HOME}/go/bin/protoc-gen-go
then I get a bunch of errors in my terminal
/usr/local/Cellar/powerlevel9k/0.6.7/functions/utilities.zsh:82: command not found: uname
/Users/cfrancia/.oh-my-zsh/oh-my-zsh.sh:69: command not found: rm
detect-clipboard:33: command not found: uname
prompt_context:13: command not found: whoami
prompt_background_jobs:1: command not found: wc
prompt_background_jobs:2: command not found: awk
Comment From: ctfrancia
SOLVED: updated path to:
export GOPATH=$HOME/Documents/goworkspace
export PATH="$PATH:$GOPATH/bin"
Comment From: ghost
SOLVED: updated path to:
shell export GOPATH=$HOME/Documents/goworkspace export PATH="$PATH:$GOPATH/bin"
thank you
Comment From: dekkicheamine27
run :
shell PATH="${PATH}:${HOME}/go/bin"
Comment From: EstellaPaula
Wow, I've been scouring the internet for this answer. Thanks a bunch!!! \ʕ•ᴥ•ʔ/
run :
shell PATH="${PATH}:${HOME}/go/bin"
Comment From: macadadi
RUN :-
echo 'export PATH="${PATH}:${HOME}/go/bin"' >> ~/.bashrc
source ~/.bashrc
Comment From: Lafetz
shell PATH="${PATH}:${HOME}/go/bin"
i was thinking about replacing grpc with something else before finding this...thanks a lot
Comment From: nadiia-kotelnikova
Will share here, maybe it will help someone: if you install go with asdf
, don't forget to run asdf reshim
after installing go program. Sometimes the issue, that bin is there and all envs set up correctly, but installed bin still not visible.
Comment From: XronTrix10
RUN :-
echo 'export PATH="${PATH}:${HOME}/go/bin"' >> ~/.bashrc
source ~/.bashrc
This is what solved my issue. Thanks
Comment From: Tahmurath
I tried all the methods but no result. Finally I switched back from zsh to bash solved the problem: chsh -s /bin/bash
Comment From: icesonata
Will share here, maybe it will help someone: if you install go with
asdf
, don't forget to runasdf reshim
after installing go program. Sometimes the issue, that bin is there and all envs set up correctly, but installed bin still not visible.
this is what i am facing currently, thanks