pythoncondahdf5h5pyconda-build

conda install and conda build result in different dependency versions


I'm trying to build a package which includes h5py. When using conda build, it seems to install the wrong version of the dependency. It installs 3.2.1-py37h6c542dc_0, which includes hdf5: 1.10.6-nompi_h6a2412b_1114.

The problem is that this hdf5 lib, seems to have these setting:

(Read-Only) S3 VFD: yes

This causes an error for me. When just running conda install h5py==3.2.1, it does install the right version (hdf5-1.10.6-nompi_h3c11f04_101).

Why is there a difference?


Solution

  • "Why is there a difference?

    Using conda install h5py=3.2.1 additionally includes all the previous constraints in the current environment, whereas during a conda build run, a new environment is created only with requirements that the package specifies. That is, it is more like running conda create -n foo h5py=3.2.1.

    So, that covers the mechanism, but we can also look at the particular package dependencies to see why the current environment constrains to the older hdf5-1.10.6-nompi_h3c11f04_101, which OP states is preferred. Here is the package info for the two:

    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
    

    The difference here is that the latter works with older versions of libgcc-ng, libstdcxx-ng, and libgfortran-ng (below 9.3.0), as well as has no constraint on openssl or libcurl. So, we can guess that the current environment where the conda install h5py=3.2.1 was invoked has one of these restrictions.