36

disclaimer: noob

OSX 10.8.5

When I installed python in bash I got this warning and error:

Warning: Could not link python. Unlinking...
Error: The 'brew link' step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using 'brew link python

So I went ahead and typed

brew link python

and got

Linking /usr/local/Cellar/python/2.7.6... Warning: Could not link python. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/python/2.7.6/bin/smtpd2.py 
Target /usr/local/bin/smtpd2.py already exists. You may need to delete it. 
To force the link and overwrite all other conflicting files, do:

brew link --overwrite formula_name

Should I do it? What does is mean to link python in this context, let alone force-link it, and what's formula_name?

This question is similar but also different, so I'm afraid to try the top rated answer as it might just dig me deeper into the rabbit hole that I am stuck in right now.

3
  • I wouldn't worry :) I'm not sure, but it seems like it simply wants to replace a symlink. I've done it a few times myself. However, don't take my word for it :p
    – keyser
    Dec 19, 2013 at 20:39
  • 4
    You can run brew doctor to see if you have any issues.
    – Yuval Adam
    Dec 19, 2013 at 20:40
  • I think it's safe to force-link it.
    – Timothy
    Dec 19, 2013 at 20:58

1 Answer 1

53

It looks like you have installed Python using another method before. Don't be scared. Homebrew is engineered so it won't mess up your system like Mac Ports et al.

You can always do brew link --overwrite --dry-run python to see first what exactly will be overwritten, without actually doing it.

If once you do this it look like it is only overwriting or deleting *.py scripts, then you should be even less scared.

2
  • Thanks! They were mostly .py docs but I overwrote it anyway and that actually solved other problems I was having too (like being able to install virtualenv). I guess this was just an issue between versions or something.
    – A__
    Dec 19, 2013 at 21:13
  • Welcome. Yeah definitely version collision. Best situation is that you fix all warnings given by brew doctor. Dec 19, 2013 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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