6

I've installed Python using homebrew. which python returns /usr/local/bin/python which should be the homebrew install, if I'm not mistaken. When I run python, I get

Python 2.7.4 (v2.7.4:026ee0057e2d, Apr  6 2013, 11:43:10)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

which tells me I'm still on version 2.7.4 rather than 2.7.5. If I then run brew upgrade python, I get Error: python-2.7.5 already installed.

Can anyone help me figure out what's happening here?

raddevon
  • 3,290
  • 4
  • 39
  • 49
  • Can it be that 2.7.5 is indeed installed and the problem is that `/usr/local/bin/python` still links to the old version. Take a look inside `/etc/` to see if you can find your 2.7.5. Does your OS have something like `update-alternatives`? – Hyperboreus Aug 04 '13 at 20:07
  • Thanks, @Hyperboreus. I think I found the solution. See my updated question. – raddevon Aug 04 '13 at 20:19
  • 1
    Glad to help. Post your update as an answer and accept, so future users facing the same problem can find it. – Hyperboreus Aug 04 '13 at 20:24

1 Answers1

6

I think I found the answer in a similar question. I was able to use @akauppi's answer to fix my problem. I'm guessing the symlink in /usr/bin/local/ was pointing to the system python or maybe just another older version I have on my system somewhere instead of the version installed by Homebrew. By running brew link --overwrite python, I was able to replace those old symlinks and I now show version 2.7.5 when I run python.

Community
  • 1
  • 1
raddevon
  • 3,290
  • 4
  • 39
  • 49