首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“坏”Python安装

“坏”Python安装
EN

Stack Overflow用户
提问于 2015-02-19 18:09:21
回答 1查看 6.7K关注 0票数 4

我最近对Python有一些问题,比如与anaconda的兼容性。当我运行Homebrew的brew doctor时,我想我遇到了这个问题,如下所示。我如何擦除这些文件并完成Python的干净安装?

代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-19 21:20:53

若要使用brew卸载,请使用此命令brew uninstall <package>

Mac已经预装了python,因此不需要安装另一个Python实例,除非它是必要的。

您可以运行brew install python来使用Homebrew安装Python。

尽管正如@jgritty在注释中所暗示的那样,python是预先安装的,但您可能会考虑不依赖它来进行开发。

所以你应该brew uninstall python然后brew install python

为了删除已安装的Python (2.7)实例,需要在终端中运行以下命令;

  1. sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7
  2. sudo rm -rf "/Applications/Python 2.7"
  3. 删除/usr/local/bin中指向此python版本的符号链接(请参阅ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7' )
  4. 如果有必要,编辑您的shell配置文件以删除添加到PATH环境文件中的/Library/Frameworks/Python.framework/Versions/2.7。根据您使用的shell,可能已经修改了以下任何一个文件:~/bash_login, ~/bash_profile, ~/cshrc, ~/profile, ~/tcshrc, and/or ~/zprofile

@Ned Deily提供的参考资料(可在this link上查阅)。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28613758

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档