【问题标题】:Reset easy_install after uninstalling Python on OS X在 OS X 上卸载 Python 后重置 easy_install
【发布时间】:2011-03-25 12:31:00
【问题描述】:

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

出于某种原因,我使用 this method 卸载了 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 for Python 2.6,但是我有 2.7。伤心:(

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

【问题讨论】:

    标签: python macos reset easy-install


    【解决方案1】:

    看起来您正在从系统 Python 2.6 运行 easy_install。 Apple 随操作系统提供 easy_install。如果您刚刚从 python.org 安装了 Python 2.7,则需要为该版本安装 distribute。 (请注意,您需要以 root 身份执行此操作,以便它可以写入 /usr/local/bin。)还有 Python 版本后缀为 easy_install 的版本,例如easy_install-2.6,所以如果出于某种原因你想在系统 Python 中安装一个包,那么你仍然可以这样做。

    另外,调查pip,它具有卸载功能。

    【讨论】:

    • 注意ActivePython已经包含了distribute、pip和virtualenv。
    • python.org Pythons,默认情况下,在框架bin目录中安装Distutils脚本,如easy_install,而不是/usr/local/binsudo 一般不需要。
    • 啊,我只使用过使用 /usr/local/bin 的 Apple Python。在这种情况下,您需要将框架 bin 目录添加到您的路径(除非安装程序这样做?)
    猜你喜欢
    • 2011-08-03
    • 2011-04-04
    • 2012-09-05
    • 2011-12-30
    • 2014-08-24
    • 1970-01-01
    • 2011-04-18
    • 1970-01-01
    相关资源
    最近更新 更多