2012-10-26 14 views
29

python throught homebrewをインストールしようとするとエラーが発生しました。どのようにすることができます。..Homebrew、pythonのインストール

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

そしてsmtpd2.pyれる存在:

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の/ usr/binとビン権:BREWは、ここに出力され、それのpythonをリンクすることができなかったものを言います修理する? smtpd2.pyを削除しますか?

+0

あなた/ could/'sudo rm -rf smtpd2'。しかし、ここではより大きな疑問があります。なぜあなたは自作を使ってPythonをインストールしていますか?なぜ[python downloads page](http://python.org/download/)から直接ダウンロードするだけではないのですか? – inspectorG4dget

+0

私はpythonだけでなく、homebrewをインストールします。メインパッケージマネージャーとしてmacportsの代わりにhomebrewを使用したいだけです。 –

+0

'brew install python --universal --framework'、私はこのコマンドを使ってインストールしました。 – iMom0

答えて

82

/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 
+3

ありがとう、これはhomebrewを通じてpythonをインストールするのに役立ちました:) –

+0

私は醸造医で、これを手に入れています - 手伝ってもらえますか?警告:pythonはPython – tbarbe

+0

にシンボリックリンクされていますが、アンインストールとキャッシュのクリア行の間に 'rm -rf/usr/local/Cellar/python'を実行してください – TomFuertes

21

brew link --overwrite pythonを試しましたか?これは私のためにPythonをアンインストールすることなく動作しました - 詳細はthis questionを参照してください。

+1

私は受け入れられた答えのように/ usr/localをchownしなければなりませんでした。 – RichVel

+1

新しいコマンドはアプリケーションへのシンボリックリンクに 'brew linkapps python'です – mateor

関連する問題