在OS X上卸载Python后重置easy_install

0 投票
1 回答
1206 浏览
提问于 2025-04-16 14:24

我一开始安装的是64位的Python,然后我用easy_install安装了BeautifulSoup。

出于某种原因,我按照这个方法卸载了64位的Python。之后我又从Python.org重新安装了32位的版本。但是:

Kit:~ Kit$ easy_install beautifulsoup
Searching for beautifulsoup
Best match: BeautifulSoup 3.2.0
Processing BeautifulSoup-3.2.0-py2.6.egg
BeautifulSoup 3.2.0 is already the active version in easy-install.pth

Using /Library/Python/2.6/site-packages/BeautifulSoup-3.2.0-py2.6.egg
Processing dependencies for beautifulsoup
Finished processing dependencies for beautifulsoup

这真是个糟糕的迹象,说明我还没找到一个简单的方法来干净地卸载OS X上的Python。而且,它提到了BeautifulSoup是针对Python 2.6的,但我用的是2.7。真让人失望:(

我该如何重置easy-install.pth?我在Spotlight上找不到它。

1 个回答

1

看起来你是在用系统自带的 Python 2.6 来运行 easy_install。苹果的系统里自带了这个工具。如果你刚从 python.org 安装了 Python 2.7,那么你需要为这个版本安装一个叫 distribute 的东西。(注意,你需要以管理员身份来做这个操作,这样它才能写入 /usr/local/bin 这个目录。)另外,还有一些带版本号的 easy_install 版本,比如 easy_install-2.6,如果你有特殊需要想在系统自带的 Python 上安装某个包,也是可以的。

另外,可以看看 pip,它有卸载功能。

撰写回答