【问题标题】:How can I install matplotlib without installing Qt using conda on Windows?如何在 Windows 上使用 conda 安装 matplotlib 而不安装 Qt?
【发布时间】:2017-08-22 12:14:08
【问题描述】:

我在 tkinter 中编写了一个使用 matplotlib 的简单 GUI 应用程序。鉴于我没有使用 Qt 后端,我想我的应用程序不需要它,所以我不想将它包含在我的 conda 环境中:我需要我的环境尽可能轻量级尽可能。不幸的是,命令“conda install matplotlib”默认安装 Qt。有没有办法防止这种情况?

我在 Windows 10 上使用 anaconda。

【问题讨论】:

  • 您可以使用conda install --no-update-dependencies package 安装没有依赖关系的包,但这是否会破坏 matplotlib 需要一些测试。
  • 谢谢。我猜你的意思是conda install --no-deps。在没有其他选择的情况下,这可能是一个解决方案。
  • 对,我错了,对不起! :-)
  • 它似乎可以工作(至少在 linux 下,tkinter 后端似乎是默认后端的功能足够的替代品)。我没有在 macOS 和 windows 上尝试过。

标签: python qt matplotlib conda


【解决方案1】:

Conda Forge 提供不包含 Qt 依赖项的 a matplotlib-base package

conda install -c conda-forge matplotlib-base

我可以确认这足以在 Jupyter 笔记本中生成图像。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-06
    • 1970-01-01
    • 1970-01-01
    • 2020-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-03
    相关资源
    最近更新 更多