python错误安装_“错误” 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.

解决方案

To uninstall using brew use this command brew uninstall .

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

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

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

So you should brew uninstall python then brew install python.

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

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

sudo rm -rf "/Applications/Python 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'

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.

A reference by @Ned Deily available at this link.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值