Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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 (, 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
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

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


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
@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
@threenovation - Can you accept the answer so it doesn't look unresolved? – beroe Aug 28 '13 at 23:25

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
Do NOT use this method for setting your path -- there is risk that non-terminal applications will pick up the "brewed" components and fail. Using "sudo" should also be a red flag unless you truly understand what you're doing (especially with a user-level development system like Mac Homebrew). Editing your .bash_profile and restarting terminal should be sufficient. – rholmes May 18 '14 at 21:04

Your Answer


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.