Conda 更新给出了复杂的依赖项名称,不像 py36_0

Conda update gives complicated dependency name, not like py36_0

我在工作中使用 Conda 已有 ~ 年了。我不是一个经验丰富的程序员,所以我不太了解它里面的内容(我只是使用python和一些相关的包来计算)。

最近,当我更新包时,其中一些显示奇怪的依赖项名称:

anaconda                  custom                   py36_0  
ccdproc                   1.2.0                    py36_0    astropy
jupyterlab_launcher       0.5.3                    py36_0    conda-forge
pyqtgraph                 0.10.0                   py36_0  
scipy                     0.19.1           py36h9976243_3  
sphinxcontrib             1.0              py36h6d0f590_1  
toolz                     0.8.2            py36h81f2dff_0

等等(随机抽取六个包)。为什么我突然有一些复杂的依赖关系,像py36h81f2dff_0,而不是py36_0?如果我做错了什么,我该如何回滚?

这是因为 conda-build 3.0 中的更改。这种情况从 7 月开始发生。请参阅来自 Continuum 的博客 post:https://www.anaconda.com/blog/developer-blog/package-better-conda-build-3/?lang=en-us

引用post中的相关位:

Wait a minute—what is that h7d013e7 gobbledygook in the build/string field?

Conda-build 3 aims to generalize pinning/constraints. Such constraints differentiate a package. For example, in the past, we have had things like py27np111 in filenames. This is the same idea, just generalized. Since we can’t readily put every possible constraint into the filename, we have kept the old ones, but added the hash as a general solution.

There’s more information about what goes into a hash at: https://conda.io/docs/building/variants.html#differentiating-packages-built-with-different-variants

需要说明的是,这些包没有问题,conda 也没有问题。