Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to install brew but get the following warning:

Warning: /usr/bin occurs before /usr/local/bin
This means that system-provided programs will be used instead of those
provided by Homebrew. The following tools exist at both paths:

2to3
2to3-2.7
idle
idle2.7
pydoc
pydoc2.7
python
python-config
python2.7
python2.7-config
pythonw
pythonw2.7
smtpd.py
smtpd2.7.py

Consider amending your PATH so that /usr/local/bin
is ahead of /usr/bin in your PATH.

I have no idea how to amend the path. I've explored several files from this stack overflow post (http://stackoverflow.com/questions/8886114/using-brew-with-ruby-1-9-2), but can't find a relevan path to edit. The only file that I do have that exists is my /etc/profile file which currently looks like:

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/2.7/local/bin:${PATH}"
export PATH

I wanted to just uninstall python then reinstall it through homebrew, but am a little nervous about breaking too many things at once.

Is there an easy way to amend the path? Should I create a .bash_profile file? Thank you for any help in advance.

share|improve this question
add comment

2 Answers

Yes, create a .bash_profile file in your home directory containing

PATH="/usr/local/bin:$PATH"

and then do one of the following to make the change active

  • execute . ~/.bash_profile
  • execute PATH="/usr/local/bin:$PATH" in the current shell
  • restart Terminal
share|improve this answer
    
Thank you! My system is now 'raring to brew' –  threenovation Apr 23 '12 at 5:30
2  
@threenovation if the answer above is correct, can I suggest you mark it as answer (click the tick next to the answer) –  Stu Wilson Apr 23 '12 at 10:37
    
I wonder if this should be exported? Child processes should have this new path also. Also: When I set up brew, it did not alert me that /usr/bin came before /usr/local/bin. –  Steven Lu May 3 '12 at 15:00
    
@StevenLu, it's already exported by the time you get to .bash_profile. It wouldn't hurt to explicitly export it again, but not necessary. –  glenn jackman May 3 '12 at 15:20
    
Thanks for this. Worked "Your system is raring to brew." –  Vezu May 29 '12 at 18:46
show 1 more comment

You need to amend /etc/paths so that /usr/local/bin is listed before /usr/bin. You'll need to sudo your editor in order to do that.

One of the ways to open editor is

 sudo open -t /etc/paths
share|improve this answer
    
My PATH was configured correctly in my .bash_profile, but not in /etc/paths. This worked beautifully. –  Nick Tomlin Jul 17 '13 at 17:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.