Mac通過Brew來安裝Python,使用Brew Doctor檢查出現關於./configure的問題,請問如何解決?
Warning:"config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
這個就是包管理軟體令人無語的地方了。Brew和官方下載Python以及Anaconda和EPD版本的Python都無法愉快玩耍。它的提示信息意思是,如果你使用了官方下載的Python,並且還把它的bin目錄加到了Path中,那麼就會引起Brewed Python在載入config文件時的混亂。
所以解決方法是,如果你打算用Brew來再裝一個Python並且打算設Brewed Python為默認,那麼就需要卸載官方下載的Python,也就是你問題裡面的Python.framework。
$ sudo rm -rf /Library/Frameworks/Python.framework
如果像我一樣不打算用Brewed Python(我自己是Anaconda),那麼就無解,只能不管這個警告了。但因為這條警告只是為了防止日後萬一安裝Brewed Python會起衝突,所以只要不安裝就沒問題啦。
文*的答覆經測實用
推薦閱讀: