conda-install和conda-build会产生不同的依赖版本



我正在尝试构建一个包含h5py的包。使用conda build时,似乎安装了错误版本的依赖项。它安装3.2.1-py37h6c542dc_0,其中包括hdf5: 1.10.6-nompi_h6a2412b_1114

问题是这个hdf5库,似乎有以下设置:

(Read-Only) S3 VFD: yes

这给我带来了一个错误。当刚运行conda install h5py==3.2.1时,它确实安装了正确的版本(hdf5-1.10.6-nompi_h3c11f04_101(。

为什么会有区别?

"为什么会有区别

使用conda install h5py=3.2.1还包括当前环境中的所有先前约束,而在conda build运行期间,仅使用包指定的要求创建新环境。也就是说,它更像是运行conda create -n foo h5py=3.2.1

因此,这涵盖了机制,但我们也可以查看特定的包依赖关系,以了解为什么当前环境限制为旧的hdf5-1.10.6-nompi_h3c11f04_101,而OP状态是首选的。这是两个的包裹信息:

hdf5-1.10.6-nompi_h6a2412b_1114

$ mamba search --info conda-forge/linux-64::hdf5[version='1.10.6',build='nompi_h6a2412b_1114']
hdf5 1.10.6 nompi_h6a2412b_1114
-------------------------------
file name   : hdf5-1.10.6-nompi_h6a2412b_1114.tar.bz2
name        : hdf5
version     : 1.10.6
build       : nompi_h6a2412b_1114
build number: 1114
size        : 3.1 MB
license     : LicenseRef-HDF5
subdir      : linux-64
url         : https://conda.anaconda.org/conda-forge/linux-64/hdf5-1.10.6-nompi_h6a2412b_1114.tar.bz2
md5         : 0a2984b78f51148d7ff6219abe73509e
timestamp   : 2021-01-08 23:10:11 UTC
dependencies: 
- libcurl >=7.71.1,<8.0a0
- libgcc-ng >=9.3.0
- libgfortran-ng
- libgfortran5 >=9.3.0
- libstdcxx-ng >=9.3.0
- openssl >=1.1.1i,<1.1.2a
- zlib >=1.2.11,<1.3.0a0

hdf5-1.10.6-nompi_h3c11f04_101

$ mamba search --info conda-forge/linux-64::hdf5[version='1.10.6',build='nompi_h3c11f04_101']
hdf5 1.10.6 nompi_h3c11f04_101
------------------------------
file name   : hdf5-1.10.6-nompi_h3c11f04_101.tar.bz2
name        : hdf5
version     : 1.10.6
build       : nompi_h3c11f04_101
build number: 101
size        : 3.0 MB
license     : HDF5
subdir      : linux-64
url         : https://conda.anaconda.org/conda-forge/linux-64/hdf5-1.10.6-nompi_h3c11f04_101.tar.bz2
md5         : 9f1ccc4d36edf8ea15ce19f52cf6d601
timestamp   : 2020-07-31 12:26:29 UTC
dependencies: 
- libgcc-ng >=7.5.0
- libgfortran-ng >=7,<8.0a0
- libstdcxx-ng >=7.5.0
- zlib >=1.2.11,<1.3.0a0

这里的区别在于,后者适用于libgcc-nglibstdcxx-nglibgfortran-ng的旧版本(低于9.3.0(,并且对openssllibcurl没有限制。因此,我们可以猜测调用conda install h5py=3.2.1的当前环境具有这些限制之一。

最新更新