Fixing homebrew path

2

1

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

Posted 2016-03-11T11:24:15.230

Reputation: 21

Answers

4

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

techraf

Posted 2016-03-11T11:24:15.230

Reputation: 4 428

the export command didn't work, brew doctor show same message even after restarting terminal session – Steven – 2016-03-11T12:14:58.943

entered export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile and hit enter – Steven – 2016-03-11T12:18:14.280

i entered brew doctor to check after i reopened the terminal and it shows the same message – Steven – 2016-03-11T12:39:51.157

'/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' – Steven – 2016-03-11T13:15:17.550

it shows nothing..i opened it with texteditor and it was empty – Steven – 2016-03-11T13:22:12.963

.bash_profile now contains export PATH="/usr/local/sbin:$PATH", wrong? – Steven – 2016-03-11T13:37:13.837

thanks it worked, but should't the .bash_profile contain only the path not export PATH = ? – Steven – 2016-03-11T13:44:03.557

it doesn't hurt – techraf – 2016-03-11T14:07:35.923