我最近遇到了 Python 的问题,例如与 anaconda 的兼容性。当我运行 Homebrew 的 brew doctor
时,我想我遇到了问题,如下所示。如何删除这些文件并全新安装 Python?
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/3.4/bin/python3-config
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4-config
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4m-config
/opt/local/bin/curl-config
/opt/local/bin/freetype-config
/opt/local/bin/libpng-config
/opt/local/bin/libpng16-config
/opt/local/bin/nc-config
/opt/local/bin/ncurses5-config
/opt/local/bin/ncursesw5-config
/opt/local/bin/pcre-config
/opt/local/bin/python2.7-config
/opt/local/bin/xml2-config
/Users/adamg/anaconda/bin/freetype-config
/Users/adamg/anaconda/bin/libdynd-config
/Users/adamg/anaconda/bin/libpng-config
/Users/adamg/anaconda/bin/libpng15-config
/Users/adamg/anaconda/bin/llvm-config
/Users/adamg/anaconda/bin/nc-config
/Users/adamg/anaconda/bin/python-config
/Users/adamg/anaconda/bin/python2-config
/Users/adamg/anaconda/bin/python2.7-config
/Users/adamg/anaconda/bin/xml2-config
/Users/adamg/anaconda/bin/xslt-config
/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
Warning: Python is installed at /Library/Frameworks/Python.framework
Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.
最佳答案
要使用 brew 卸载,请使用此命令 brew uninstall <package>
.
Mac OS X 预装了 python,因此除非必要,否则无需安装另一个 Python 实例。
您可以运行 brew install python
使用 Homebrew 安装 Python。
即使 python 预安装为 @jgritty在评论中提示,您可以考虑不要依赖它进行开发。
所以你应该brew uninstall python
然后brew install python
.
要删除已安装的 Python (2.7) 实例,您需要在终端中运行以下命令;
sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
sudo rm -rf "/Applications/Python 2.7"
删除
/usr/local/bin
中的符号链接(symbolic link)指向此 python 版本的内容请参阅ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7'
如有必要,编辑您的 shell 配置文件以删除添加
/Library/Frameworks/Python.framework/Versions/2.7
到您的 PATH 环境文件。根据您使用的 shell,以下任何文件都可能已被修改:~/bash_login, ~/bash_profile, ~/cshrc, ~/profile, ~/tcshrc, and/or ~/zprofile
.
引用 @Ned Deily可在this link获得.
关于python - "Bad"Python安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28613758/