Fixing homebrew path

14,535

It might be unrelated to the problem with Python, but at this moment, you should do exactly what the message says, i.e. type the following command:

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

After that reopen terminal session or run . ~/.bash_profile command.

It just says that some of the programs you installed with homebrew are placed in /usr/local/sbin directory, but your shell "does not know" about them.

For a reference you can check which programs (formulae) are there by listing the contents:

ls /usr/local/sbin

As for checking Python, type:

ls -l `which python`

It will give you the path to the current executable. You want it the output to look this way:

lrwxrwxr-x  1 root  admin  34 Dec 14 21:12 /usr/local/bin/python@ -> ../Cellar/python/2.7.11/bin/python
Share:
14,535

Related videos on Youtube

Steven
Author by

Steven

Updated on September 18, 2022

Comments

  • Steven
    Steven over 1 year

    I'm learning Python and most tutorials recommend to install Python using homebrew so I installed homebrew then I typed:

    brew install python
    

    which should overwrite OS X Python 2.7.10 with 2.7.11 but I think it didn't and when I enter:

    brew doctor
    

    I get:

    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"' >> ~/.bash_profile

    What should I do? Should I uninstall everything and start over?

  • Steven
    Steven about 8 years
    the export command didn't work, brew doctor show same message even after restarting terminal session
  • Steven
    Steven about 8 years
    entered export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile and hit enter
  • Steven
    Steven about 8 years
    i entered brew doctor to check after i reopened the terminal and it shows the same message
  • Steven
    Steven about 8 years
    '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
  • Steven
    Steven about 8 years
    it shows nothing..i opened it with texteditor and it was empty
  • Steven
    Steven about 8 years
    .bash_profile now contains export PATH="/usr/local/sbin:$PATH", wrong?
  • Steven
    Steven about 8 years
    thanks it worked, but should't the .bash_profile contain only the path not export PATH = ?
  • techraf
    techraf about 8 years
    it doesn't hurt