Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Homebrew , python installing

i got an error while trying to install python throught homebrew. brew says what it failed to link python , here is output:

Linking /usr/local/Cellar/python/2.7.3... Warning: Could not link python. Unlinking... Error: Could not symlink file: /usr/local/Cellar/python/2.7.3/bin/smtpd2.py /usr/local/bin/smtpd2.py may already exist. /usr/local/bin may not be writable. 

ls -la on /usr/bin and bin rights :

The drwxrwxrwx  26 root             admin  884 26 Oct 16:03 bin 

And smtpd2.py is exists.. How can i fix it? Delete smtpd2.py ?

like image 489
Andrey Baryshnikov Avatar asked Oct 26 '12 14:10

Andrey Baryshnikov


People also ask

What is the best way to install Python on Mac?

The easiest way to safely install python on a MAC is homebrew. Homebrew installs a new version of python (by default the latest 2. x version available) and set is as default. and the label “(box)” should disappear from your terminal.

How do I install Python on my Macbook?

Install Python 3 with the Official Installer First, download an installer package from the Python website. To do that, visit https://www.python.org/downloads/ on your Mac; it detects your operating system automatically and shows a big button for downloading the latest version of Python installer on your Mac.


1 Answers

Sounds like a permissions issue with /usr/local.

### Makes you owner of /usr/local  $ sudo chown -R `whoami` /usr/local  ### Force uninstalls failed python $ brew uninstall -f python  ### Clear the brew cache $ rm -rf `brew --cache`  ### Recreate the brew cache $ mkdir `brew --cache`  ### Cleanup - cleans up old homebrew files $ brew cleanup  ### Prune - removes dead symlinks in homebrew $ brew prune  ### Doctor - runs homebrew checks for common error causing issues $ brew doctor  ######## ### Google and follow steps to fix what `brew doctor` came back with ########  ### Reinstall python $ brew install python 
like image 173
TomFuertes Avatar answered Sep 22 '22 01:09

TomFuertes