如何解释 conda 包冲突? [英] How to interpret conda package conflicts?

查看:285
本文介绍了如何解释 conda 包冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个包含 3 个包和特定 python 版本的 conda 环境并获得以下输出:

I am attempting to create a conda environment with 3 packages and a specific python version and get the following output:

$ conda create -n testing_junk -y instrain awscli samtools python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                                             \

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package ncurses conflicts for:
python=3.8 -> ncurses[version='>=6.1,<6.2.0a0|>=6.2,<7.0a0|>=6.1,<7.0a0']
awscli -> python[version='>=3.8,<3.9.0a0'] -> ncurses[version='5.9.*|5.9|>=6.1,<6.2.0a0|>=6.2,<7.0a0|>=6.1,<7.0a0|>=6.0,<7.0a0|6.0.*']
instrain -> python[version='>=3.4'] -> ncurses[version='5.9.*|5.9|>=6.1,<6.2.0a0|>=6.2,<7.0a0|>=6.1,<7.0a0|>=6.0,<7.0a0|6.0.*']
python=3.8 -> readline[version='>=7.0,<8.0a0'] -> ncurses[version='5.9.*|>=6.0,<7.0a0|6.0.*']
samtools -> ncurses[version='5.9|5.9.*|>=5.9,<5.10.0a0|>=6.1,<6.2.0a0']

Package python conflicts for:
awscli -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.5,<3.6.0a0|3.4.*']
python=3.8
instrain -> biopython -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0|3.4.*|>3|>=3.5|<3.0.0|>=3.6']
instrain -> python[version='>=3.4']
awscli -> python_abi=3.8[build=*_cp38] -> python[version='3.7.*|3.8.*']

Package ca-certificates conflicts for:
samtools -> openssl[version='>=1.1.1a,<1.1.2a'] -> ca-certificates
python=3.8 -> openssl[version='>=1.1.1g,<1.1.2a'] -> ca-certificates
awscli -> python[version='>=2.7,<2.8.0a0'] -> ca-certificates

Package setuptools conflicts for:
python=3.8 -> pip -> setuptools
instrain -> matplotlib-base -> setuptools[version='>=40.0']

Package libgcc-ng conflicts for:
samtools -> ncurses[version='>=6.1,<6.2.0a0'] -> libgcc-ng[version='>=7.2.0']
samtools -> libgcc-ng[version='>=4.9|>=7.3.0']

Package pypy3.6 conflicts for:
instrain -> numpy -> pypy3.6[version='7.3.0.*|7.3.1.*|>=7.3.1']
awscli -> python[version='>=3.6,<3.7.0a0'] -> pypy3.6[version='7.3.*|7.3.0.*|7.3.1.*']

Package bzip2 conflicts for:
samtools -> bzip2[version='1.0.*|>=1.0.6,<2.0a0|>=1.0.8,<2.0a0']
instrain -> pysam -> bzip2[version='>=1.0.6,<2.0a0|>=1.0.8,<2.0a0']
awscli -> python[version='>=3.7,<3.8.0a0'] -> bzip2[version='>=1.0.6,<2.0a0|>=1.0.8,<2.0a0']

Package zlib conflicts for:
samtools -> zlib[version='1.2.11.*|>=1.2.11,<1.3.0a0|1.2.8.*|1.2.8']
samtools -> curl[version='>=7.59.0,<8.0a0'] -> zlib[version='1.2.*|1.2.11']

Package samtools conflicts for:
samtools
instrain -> pysam -> samtools[version='1.3|1.3.1.*|1.3.1|1.5.*|1.6.*|1.7|1.7.*|1.9.*|>=1.4.1|>=1.4.1,<1.5|>=1.4,<1.5|>=1.3,<1.4|>=1.3']

Package openssl conflicts for:
samtools -> curl[version='>=7.59.0,<8.0a0'] -> openssl[version='1.0.*|>=1.0.2o,<1.0.3a|>=1.0.2m,<1.0.3a']
samtools -> openssl[version='>=1.0.2p,<1.0.3a|>=1.0.2r,<1.0.3a|>=1.1.1a,<1.1.2a']

Package _libgcc_mutex conflicts for:
samtools -> libgcc-ng[version='>=7.3.0'] -> _libgcc_mutex[version='*|0.1',build='main|conda_forge']
python=3.8 -> libgcc-ng[version='>=7.5.0'] -> _libgcc_mutex[version='*|0.1',build='main|conda_forge']The following specifications were found to be incompatible with your CUDA driver:

  - feature:/linux-64::__cuda==10.2=0
  - feature:|@/linux-64::__cuda==10.2=0

Your installed CUDA driver is: 10.2

我知道软件包之间存在一些冲突,但我无法解释此输出以了解问题所在.

I understand that there is something about the packages that conflict with each other, but I'm unable to interpret this output to understand what the problem is.

例如,在查看第一个冲突块(与 ncurses 相关)时,6.1 版不应该满足列出的所有要求吗?

For example, in looking at the first block of conflicts (related to ncurses), shouldn't version 6.1 satisfy all requirements listed?

另外,关于包setuptools的块,我看不出有什么问题?

Additionally, for the block about package setuptools, I don't see any problem at all?

任何有关如何解释这些冲突以便我可以尝试解决它们的见解将不胜感激.

Any insight into how to interpret these conflicts so that I can attempt to address them would be much appreciated.

推荐答案

一些实用建议

@Quantum7 的回答 对 Conda 的冲突报告给出了很好的字面解释.然而,我想提供一个更实用的观点,那就是这个功能"很重要.来自 Conda 太非特定,在大多数非平凡环境中都没有用.有时它甚至不包括潜在的冲突.不要浪费你的时间!

Some Practical Advice

@Quantum7's answer gives a fine literal interpretation of Conda's conflict reporting. However, I wanted to offer a more practical take, which is that this "feature" from Conda is too non-specific to be useful in most non-trivial environments. And sometimes it won't even include the underlying conflict. Don't waste your time with it!

从表面上看,Conda 试图报告所有可能的冲突来源.也就是说,依赖图中的所有路径集都从显式规范开始并在同一个包中结束.这相当于报道的大部分内容是无害的,坦率地说是分散注意力.例如,zlib冲突":

On the face of it, Conda attempts to report all possible sources of conflict. That is, all sets of paths in the dependency graph that begin from the explicit specifications and end in the same package. This amounts to most of what is reported being innocuous and frankly distracting. For example, the zlib "conflicts":

Package zlib conflicts for:
samtools -> zlib[version='1.2.11.*|>=1.2.11,<1.3.0a0|1.2.8.*|1.2.8']
samtools -> curl[version='>=7.59.0,<8.0a0'] -> zlib[version='1.2.*|1.2.11']

由于 samtools 直接和间接依赖于 zlib(通过 curl 介导),因此出现了两条导致约束的替代路径.问题是最终约束的交集不为空,因此这里没有不兼容的东西.

Since samtools depends on zlib both directly and indirectly (mediated through curl), this comes up as two alternate paths that lead to constraints. The problem is that the intersection of the final constraints are not empty, such that there is nothing incompatible here.

此外,在某些情况下,报告的内容都没有冲突(例如,这个问题),这意味着解析输出可能完全是浪费时间.

Furthermore, there are cases where none of what is reported is in conflict (e.g., this question), which means parsing through the output could be a complete waste of time.

相反,如果人们真正关心解决冲突,我发现使用 Mamba 更有效,无论是速度还是精度.

Instead, if one is actually concerned with resolving conflicts, I find Mamba to be more effective to work with, both in speed and precision.

# install mamba
conda install -n base conda-forge::mamba

# use 'mamba' just like 'conda'
mamba create -n foo instrain awscli samtools python=3.8

不幸的是,这个例子现在可以正常工作.但是,还有其他问题可以比较 Conda 和 Mamba 的不满意报告,例如,这个问题.

Unfortunately, this example simply works now. However, there are other questions where Conda and Mamba unsatisfiability reporting is compared, e.g., this question.

这篇关于如何解释 conda 包冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆