conda-forge/opencv-feedstock

Issues installing opencv with python 3.10 + nginx

igozali opened this issue · 7 comments

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

I tried creating a new conda environment with just 3 packages:

igozali@hostname $ mamba create -p ./test_env -c conda-forge python=3.10 opencv nginx

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (0.3.7) supported by @QuantStack

        GitHub:  https://github.com/QuantStack/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████

conda-forge/linux-64     Using cache
conda-forge/noarch       Using cache
pkgs/main/linux-64       [====================] (00m:00s) No change
pkgs/main/noarch         [====================] (00m:00s) No change
pkgs/r/linux-64          [====================] (00m:00s) No change
pkgs/r/noarch            [====================] (00m:00s) No change

Looking for: ['python=3.10', 'opencv', 'nginx']

Encountered problems while solving.
Problem: nothing provides libopencv 4.2.0 py36_5 needed by opencv-4.2.0-py36_5

Using python 3.9 resolves properly, however!

Installed packages

# packages in environment at /data/shared/conda-base/miniconda-py38_4.8.3:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
bzip2                     1.0.8                h516909a_3    conda-forge
ca-certificates           2021.10.8            ha878542_0    conda-forge
certifi                   2021.10.8        py38h578d9bd_2    conda-forge
cffi                      1.14.0           py38he30daa8_1
chardet                   3.0.4                 py38_1003
conda                     4.8.3                    py38_0
conda-package-handling    1.6.1            py38h7b6447c_0
cryptography              2.9.2            py38h1ba5d50_0
icu                       67.1                 he1b5a44_0    conda-forge
idna                      2.9                        py_1
krb5                      1.17.1               h173b8e3_0    
ld_impl_linux-64          2.33.1               h53a641e_7
libarchive                3.3.3                h5d8350f_5    
libcurl                   7.69.1               h20c2e04_0    
libedit                   3.1.20181209         hc058e9b_0
libffi                    3.3                  he6710b0_1
libgcc-ng                 9.1.0                hdf63c60_0
libiconv                  1.16                 h516909a_0    conda-forge
libsolv                   0.7.14               h8b12597_0    conda_forge
libssh2                   1.9.0                h1ba5d50_1    
libstdcxx-ng              9.1.0                hdf63c60_0
libxml2                   2.9.10               h68273f3_2    conda-forge
lz4-c                     1.8.3             he1b5a44_1001    conda-forge
lzo                       2.10              h516909a_1000    conda-forge
mamba                     0.3.7            py38h77160cf_0    conda_forge
ncurses                   6.2                  he6710b0_1
openssl                   1.1.1g               h7b6447c_0
pip                       20.0.2                   py38_3
pycosat                   0.6.3            py38h7b6447c_1
pycparser                 2.20                       py_0
pyopenssl                 19.1.0                   py38_0
pysocks                   1.7.1                    py38_0
python                    3.8.3                hcff3b4d_0
python_abi                3.8                      2_cp38    conda-forge
readline                  8.0                  h7b6447c_0
requests                  2.23.0                   py38_0
ruamel_yaml               0.15.87          py38h7b6447c_0
setuptools                46.4.0                   py38_0
six                       1.14.0                   py38_0
sqlite                    3.31.1               h62c20be_1
tk                        8.6.8                hbc83047_0
tqdm                      4.46.0                     py_0
urllib3                   1.25.8                   py38_0
wheel                     0.34.2                   py38_0
xz                        5.2.5                h7b6447c_0
yaml                      0.1.7                had09818_2
zlib                      1.2.11               h7b6447c_3
zstd                      1.3.7                h0b5b093_0    

Environment info

igozali@hostname $ conda info

     active environment : base
    active env location : /data/shared/conda-base/miniconda-py38_4.8.3
            shell level : 2
       user config file : /home/igozali/.condarc
 populated config files : /data/shared/conda-base/miniconda-py38_4.8.3/.condarc
          conda version : 4.8.3
    conda-build version : not installed
         python version : 3.8.3.final.0
       virtual packages : __cuda=11.4
                          __glibc=2.27
       base environment : /data/shared/conda-base/miniconda-py38_4.8.3  (writable)
           channel URLs :
          package cache : /home/igozali/.conda/pkgs
                          /data/shared/conda-base/miniconda-py38_4.8.3/pkgs
       envs directories : /home/igozali/.conda/envs
                          /data/shared/conda-envs
                          /data/shared/conda-base/miniconda-py38_4.8.3/envs
               platform : linux-64
             user-agent : conda/4.8.3 requests/2.23.0 CPython/3.8.3 Linux/4.18.0-18-generic ubuntu/18.04.3 glibc/2.27
                UID:GID : 6011338:100
             netrc file : /home/igozali/.netrc
           offline mode : False

I did a little bit of digging, but not sure I have a solution yet. I think nginx being pinned to libgd 2.2.* may be part of the issue. That forces use of a year old build of libgd, which has some similar dependencies as opencv. Seems to me like this is more likely a dependency conflict across those packages than a specific issue with the opencv package, but let's keep this open until more is understood of the issue.

Hey, thanks for looking into this @hajapy! One thing I thought was weird was if I had used python 3.9 instead e.g. mamba create -p ./test_env -c conda-forge python=3.9 opencv nginx, the env creation would succeed. I'm not much of a conda expert myself, but please let me know if I need to report this on a different feedstock repo as well.

It seems that the pinning is there from 5 years ago, when this was the accepted way of managing pinnings

image

I'm making a PR unblocking that pin. It might be a few days before it gets merged by a maintainer. Ping me on the nginx feedstock in 5 days if you don't hear back from anybody else.

conda-forge/nginx-feedstock#67

Thanks again for looking into this! 🙏

@igozali is this issue resolved for you now?

probably.

Resolved indeed, thank you!

igozali@hostname $ mamba create -p ./test_env -c conda-forge python=3.10 opencv nginx

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (0.22.1) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████


Looking for: ['python=3.10', 'opencv', 'nginx']

warning  libmamba Could not parse mod/etag header
warning  libmamba Could not parse mod/etag header
warning  libmamba Could not parse mod/etag header
warning  libmamba Could not parse mod/etag header
pkgs/main/noarch                                   808.0kB @   1.9MB/s  0.5s
pkgs/r/linux-64                                      1.1MB @   2.0MB/s  0.7s
pkgs/r/noarch                                      482.4kB @ 711.7kB/s  0.3s
pkgs/main/linux-64                                   4.4MB @   3.9MB/s  1.7s
conda-forge/noarch                                   7.9MB @   2.5MB/s  4.1s
conda-forge/linux-64                                22.5MB @   2.8MB/s 11.4s
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/libdrm-2.4.109-h7f98852_0' has invalid 'repodata_record.json' file: [json.exception.type_error.302] type must be string, but is null
warning  libmamba Could not validate package '/home/igozali/.conda/pkgs/libllvm13-13.0.1-hf817b99_2/info/repodata_record.json': md5 and sha256 sum unknown.
    Set safety_checks to disabled to override this warning.
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/libllvm13-13.0.1-hf817b99_2' has invalid size
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/libllvm13-13.0.1-hf817b99_2' has no checksum
warning  libmamba Could not validate package '/home/igozali/.conda/pkgs/libclang-13.0.1-default_hc23dcda_0/info/repodata_record.json': md5 and sha256 sum unknown.
    Set safety_checks to disabled to override this warning.
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/libclang-13.0.1-default_hc23dcda_0' has invalid size
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/libclang-13.0.1-default_hc23dcda_0' has no checksum
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/xorg-libxext-1.3.4-h7f98852_1' has invalid 'repodata_record.json' file: [json.exception.type_error.302] type must be string, but is null
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/libva-2.14.0-h7f98852_0' has invalid 'repodata_record.json' file: [json.exception.type_error.302] type must be string, but is null
warning  libmamba Extracted package cache '/home/igozali/.conda/pkgs/ffmpeg-4.4.1-hd7ab26d_2' has invalid 'repodata_record.json' file: [json.exception.type_error.302] type must be string, but is null
Transaction

  Prefix: /home/igozali/test_env

  Updating specs:

   - python=3.10
   - opencv
   - nginx


  Package                           Version  Build                Channel                    Size
───────────────────────────────────────────────────────────────────────────────────────────────────
  Install:
───────────────────────────────────────────────────────────────────────────────────────────────────

  + _libgcc_mutex                       0.1  conda_forge          conda-forge/linux-64     Cached
  + _openmp_mutex                       4.5  1_gnu                conda-forge/linux-64     Cached
  + alsa-lib                          1.2.3  h516909a_0           conda-forge/linux-64     Cached
  + aom                               3.3.0  h27087fc_1           conda-forge/linux-64     Cached
  + bzip2                             1.0.8  h7f98852_4           conda-forge/linux-64     Cached

...truncated...

  + zlib                             1.2.11  h166bdaf_1014        conda-forge/linux-64     Cached
  + zstd                              1.5.2  ha95c52a_0           conda-forge/linux-64      469kB

  Summary:

  Install: 131 packages

  Total download: 257MB

───────────────────────────────────────────────────────────────────────────────────────────────────

Confirm changes: [Y/n] Y