“不良"是指Python安装 [英] "Bad" Python Install

查看:137
本文介绍了“不良"是指Python安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了Python问题,例如与anaconda的兼容性.当我运行Homebrew的brew doctor时,我认为我遇到了这个问题,如下所示.如何清除这些文件并执行Python的全新安装?

I've been having issues with Python recently, such as compatibility with anaconda. When I ran Homebrew's brew doctor, I think I came across the problem, as laid out below. How can I wipe these files and do a clean install of 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>.

To uninstall using brew use this command brew uninstall <package>.

Mac OS X已预先安装了python,因此除非有必要,否则无需安装其他Python实例.

Mac OS X has python preinstalled so there is no need to install another Python instance unless it's necessary.

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

You can run brew install python to install Python using Homebrew.

即使python在注释中暗示为 @jgritty 预装,您仍可以考虑不要出于开发目的而依赖它

Even though python is preinstalled as @jgritty hinted in comments, you may consider not to rely on it for development purposes.

所以您应该先brew uninstall python然后brew install python.

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

In order to remove an installed Python (2.7) instance, you need to run the following commands in your terminal;

  1. sudo rm -rf /Library/Frameworks/Python.framework/Versions/2.7

sudo rm -rf "/Applications/Python 2.7"

删除/usr/local/bin中指向此python版本的符号链接,请参见ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7'

remove the symbolic links in /usr/local/bin that point to this python version see ls -l /usr/local/bin | grep '../Library/Frameworks/Python.framework/Versions/2.7'

如有必要,请编辑您的外壳配置文件,以删除将/Library/Frameworks/Python.framework/Versions/2.7添加到PATH环境文件中的情况.根据您使用的外壳,可能会修改以下任何文件:~/bash_login, ~/bash_profile, ~/cshrc, ~/profile, ~/tcshrc, and/or ~/zprofile.

if necessary, edit your shell profile file(s) to remove adding /Library/Frameworks/Python.framework/Versions/2.7 to your PATH environment file. Depending on which shell you use, any of the following files may have been modified: ~/bash_login, ~/bash_profile, ~/cshrc, ~/profile, ~/tcshrc, and/or ~/zprofile.

@Ned Deily 提供的参考资料可在

A reference by @Ned Deily available at this link.

这篇关于“不良"是指Python安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆