【问题标题】:How do I tell OSX to use matplotlib from brew, rather than default?如何告诉 OSX 使用 brew 中的 matplotlib,而不是默认值?
【发布时间】:2015-01-28 14:59:35
【问题描述】:

我有 OSX 10.9.5 并通过 brew 安装了 matplotlib,但显然也有一个捆绑版本。 brew 的版本是 1.4.2,捆绑的版本是 1.1.1,当我 import matplotlib 我得到 1.1.1。 我是python初学者,如何让它使用brew(1.4.2)版本?

【问题讨论】:

  • 您的 python 是否也通过 brew 安装?如果不是,您可能想通过那里安装并确保路径设置正确。
  • 这条线索引导我找到解决方案,这就是解决问题的方法。 brew rm python 然后brew rm matplotlib 然后brew install python 然后brew install matplotlib。谢谢。如果您想提交答案,我会接受。
  • 很高兴听到它成功了!

标签: python macos python-2.7 matplotlib homebrew


【解决方案1】:

由于 python 环境的工作原理,python 和 matplotlib 都需要在 OS X 上通过 homebrew 安装。安装后确保你的 python 路径设置为通过 brew 安装的路径。

删除 python 和 matplotlib,以防它们是通过 brew 安装的:

 brew rm python; brew rm matplotlib

重新安装python和matplotlib:

 brew install python; brew install matplotlib

【讨论】:

    猜你喜欢
    • 2019-08-25
    • 1970-01-01
    • 1970-01-01
    • 2023-03-18
    • 2012-10-27
    • 2011-05-14
    • 2013-04-28
    • 2015-08-16
    • 2017-09-18
    相关资源
    最近更新 更多