【问题标题】:OSX - can't find what's adding python to my pathOSX - 找不到将 python 添加到我的路径的内容
【发布时间】:2014-12-18 00:58:11
【问题描述】:

我刚刚升级到 OSX Yosemite。我正在运行brew doctor,它生成的无数警告中包括:

Warning: /usr/local/share/python is not needed in PATH.
Formerly homebrew put Python scripts you installed via `pip` or `pip3`
(or `easy_install`) into that directory above but now it can be removed
from your PATH variable.
Python scripts will now install into /usr/local/bin.
You can delete anything, except 'Extras', from the /usr/local/share/python
(and /usr/local/share/python3) dir and install affected Python packages
anew with `pip install --upgrade`.

我到处都仔细查看过,我找不到将 /usr/local/share/python 添加到我的路径的内容。我的 .bash_profile 没有提到 python。 /private/etc/paths.d 仅包含一个名为“git”的文件。我确实在 /private/etc/paths 中找到了 /usr/local/share/python 的实例,但我删除了它,但是当我在那之后启动一个新终端并重新运行 brew doctor 时,我仍然收到警告。谁能建议我如何阻止这种情况?快把我逼疯了!

【问题讨论】:

  • ...人们仍然问我为什么我更喜欢 macports 而不是 brew(优胜美地升级后对我来说没有问题):P
  • 如果您有一段时间没有升级 brew,这可能是一种症状(它甚至在错误消息中说明了这一点)。以前 brew 使用 /usr/local/share/python。 FWIW 我在升级时没有遇到这样的警告(但这可能是因为我非常保护我的 PATH)。

标签: python macos homebrew path-variables


【解决方案1】:

我无法发表评论,虽然我没有答案,但这可能有助于消除过程,或者可能有助于您未来的问题解决者。

  • etc/profile 呢;该文件有任何登录吗?
  • 你有~/.profile 吗?
  • 当您:echo $PATH,有任何上述路径的迹象时,您会得到什么?
  • exportdeclare(没有选项)呢?
  • 您现在如何设置/导出您想要的路径?

可能不是您想听到的,但我总是进行全新安装而不是升级,以免出现此类问题。这样做很可能会解决您的问题;数以万计的他们。我知道自从我搬到优胜美地以来,我没有遇到任何问题,甚至没有来自 Homebrew 的警告。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-13
    • 1970-01-01
    • 1970-01-01
    • 2023-03-14
    • 2013-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多