【问题标题】:Conda install takes forever (stuck as SAT solver)Conda 安装需要永远(卡在 SAT 求解器中)
【发布时间】:2019-05-22 17:22:03
【问题描述】:

如何解决 conda 安装程序的问题,这需要永远解决巨大的 SAT 问题(为什么我们需要解决它们?):

DEBUG conda.common.logic:_run_sat(734): Invoking SAT with clause count: 9661561
DEBUG conda.common.logic:_run_sat(734): Invoking SAT with clause count: 5164645
DEBUG conda.common.logic:_run_sat(734): Invoking SAT with clause count: 2751948
DEBUG conda.common.logic:_run_sat(734): Invoking SAT with clause count: 1518175
DEBUG conda.common.logic:_run_sat(734): Invoking SAT with clause count: 964848
DEBUG conda.common.logic:_run_sat(734): Invoking SAT with clause count: 1249154
DEBUG conda.common.logic:_run_sat(734): Invoking SAT with clause count: 1105581

等了半个多小时,除了重新安装,我还能做什么?

【问题讨论】:

  • why do we need to solve them? conda 中的 SAT 用作底层求解器以满足依赖关系
  • 真正的解决方案是创建一个 bat/sh 脚本来恢复您当前的环境,并每隔 3 个月左右擦除/重新安装 anaconda

标签: python miniconda


【解决方案1】:

conda 在试图找出一种方法来满足已安装包的所有依赖项以及您要应用的更改时,可能会陷入无限循环。我在某处读到,如果它在两分钟内没有找到解决方案,那么再等待也没有意义。

一般来说,您可以通过更具体地了解自己想要的东西来克服这种情况。例如,指定确切的版本而不仅仅是包名称。如果您不需要 conda-forge,请避免使用该通道,因为它会带来 SAT 解析器会尝试考虑的大量元数据。

这里有一篇来自 Anaconda 的大型博客文章,其中介绍了提高性能的方法:
https://www.anaconda.com/understanding-and-improving-condas-performance/

【讨论】:

    【解决方案2】:

    我通过修改 ~/.condarc 解决了这个问题

    换句话说,conda-forge 太慢了,所以要让求解器优先考虑默认值

    通过改变这个:

    auto_activate_base: false
    channels:
      - conda-forge
      - defaults
    channel_priority: strict
    allow_conda_downgrades: true
    

    到这里:

    auto_activate_base: false
    channels:
      - defaults
      - conda-forge
    channel_priority: strict
    allow_conda_downgrades: true
    

    【讨论】:

      【解决方案3】:

      试试:

      conda update -n base -c defaults conda
      

      【讨论】:

        猜你喜欢
        • 2022-11-07
        • 1970-01-01
        • 2021-04-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-12-08
        • 2011-04-29
        相关资源
        最近更新 更多