Mac brew doctor show Warning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin

Viewed 15208

I try to upgrade python2.7 to python3 on macOS Catalina, when I run brew doctor, it shows:

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so:
  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

So I try the command echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc which did not works.

4 Answers

Apple macOS has moved from Bash shell to Zsh (Z Shell).

Solution:
Run the command below in your terminal:

echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

Now quit the terminal by pressing command+q, re-open the terminal and run brew doctor

You need to close and re-open your terminar after applying:

echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc

After some search I found the commands that works for me:

export PATH="/usr/local/bin:$PATH"
source ~/.bash_profile

If you write brew doctor in the IDE terminal, then do it in the system terminal, it should work

Related