4

I'm trying to create a new conda enviornment with tensorflow (GPU), version 1.4.1 with the following command conda create -n parsim_1.4.1 python=3 tensorflow-gpu=1.4.1.

However, it prints a weird conflict:

$ conda create -n parsim_1.4.1 python=3 tensorflow-gpu=1.4.1
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 python conflicts for:
python=3
tensorflow-gpu=1.4.1 -> tensorflow-gpu-base==1.4.1 -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0']The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.17=0
  - python=3 -> libgcc-ng[version='>=9.3.0'] -> __glibc[version='>=2.17']

Your installed version is: 2.17

My OS is CentOS7, and

$ uname -a
Linux cpu-s-master 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

What's wrong here? How can I fix it?

EDIT

Thanks to @merv's comment, I've tried with Mamba, and indeed it gave better error message (and much much faster). If anyone's interested, that's the command that successfully installed my required versions:

mamba create -n parsim python=3 "tensorflow-gpu=1.4" pillow opencv -c shuangnan -c anaconda
Zvika
  • 1,542
  • 2
  • 17
  • 21
  • 2
    Try it with Mamba instead. Conda's error reporting [is not the best](https://stackoverflow.com/a/69137255/570918). – merv Mar 20 '22 at 19:28
  • Your comment can qualify as answer, using Mamba indeed solved my problem. – Zvika Mar 21 '22 at 12:09
  • 1
    I gave an answer, but didn't seem like Mamba alone solves the problem - just makes it easier to debug. In the end, it was about adding a channel that provides `cudatoolkit=8.0` (**free**, is what I would recommend since it is official). – merv Mar 21 '22 at 19:45

1 Answers1

6

Conda's error reporting isn't always helpful. Mamba is sometimes better, and in this particular case it gives:

Looking for: ['python=3', 'tensorflow-gpu=1.4.1']

conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache
pkgs/main/linux-64                                            No change
pkgs/main/noarch                                              No change
pkgs/r/linux-64                                               No change
pkgs/r/noarch                                                 No change
Encountered problems while solving:
  - nothing provides cudatoolkit 8.0.* needed by tensorflow-gpu-base-1.4.1-py27h01caf0a_0

Even here, that py27 in the build string is weird, but it at least directs us to cudatoolkit 8.0, which is no longer hosted in the main channel. Instead, you need to include the free channel. The following works for me:

$ CONDA_SUBDIR=linux-64 CONDA_CHANNEL_PRIORITY=flexible \
  mamba create -n foo \
  -c anaconda -c free \
  python=3 tensorflow-gpu=1.4.1


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

        mamba (0.21.1) supported by @QuantStack

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

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


Looking for: ['python=3', 'tensorflow-gpu=1.4.1']

anaconda/linux-64                                           Using cache
anaconda/noarch                                             Using cache
conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache
pkgs/main/noarch                                              No change
pkgs/main/linux-64                                            No change
pkgs/r/linux-64                                               No change
pkgs/r/noarch                                                 No change
free/linux-64                                                 No change
free/noarch                                                   No change
Transaction

  Prefix: /Users/mfansler/miniconda3/envs/foo

  Updating specs:

   - python=3
   - tensorflow-gpu=1.4.1


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

  + blas                             1.0  openblas        anaconda/linux-64      49kB
  + bleach                         1.5.0  py36_0          free/linux-64          22kB
  + ca-certificates           2020.10.14  0               anaconda/linux-64     131kB
  + certifi                    2020.6.20  py36_0          anaconda/linux-64     163kB
  + cudatoolkit                      8.0  3               free/linux-64         338MB
  + cudnn                          7.1.3  cuda8.0_0       anaconda/linux-64     241MB
  + html5lib                   0.9999999  py36_0          free/linux-64         181kB
  + importlib-metadata             2.0.0  py_1            anaconda/noarch        36kB
  + ld_impl_linux-64              2.33.1  h53a641e_7      anaconda/linux-64     660kB
  + libedit                 3.1.20191231  h14c3975_1      anaconda/linux-64     124kB
  + libffi                           3.3  he6710b0_2      anaconda/linux-64      55kB
  + libgcc-ng                      9.1.0  hdf63c60_0      anaconda/linux-64       8MB
  + libgfortran-ng                 7.3.0  hdf63c60_0      anaconda/linux-64       1MB
  + libopenblas                   0.3.10  h5a2b251_0      anaconda/linux-64       8MB
  + libprotobuf                 3.13.0.1  hd408876_0      anaconda/linux-64       2MB
  + libstdcxx-ng                   9.1.0  hdf63c60_0      anaconda/linux-64       4MB
  + markdown                       3.3.2  py36_0          anaconda/linux-64     126kB
  + ncurses                          6.2  he6710b0_1      anaconda/linux-64       1MB
  + numpy                         1.19.1  py36h30dfecb_0  anaconda/linux-64      21kB
  + numpy-base                    1.19.1  py36h75fe3a5_0  anaconda/linux-64       5MB
  + openssl                       1.1.1h  h7b6447c_0      anaconda/linux-64       4MB
  + pip                           20.2.4  py36_0          anaconda/linux-64       2MB
  + protobuf                    3.13.0.1  py36he6710b0_1  anaconda/linux-64     715kB
  + python                        3.6.12  hcff3b4d_2      anaconda/linux-64      36MB
  + readline                         8.0  h7b6447c_0      anaconda/linux-64     438kB
  + setuptools                    50.3.0  py36hb0f4dca_1  anaconda/linux-64     913kB
  + six                           1.15.0  py_0            anaconda/noarch        13kB
  + sqlite                        3.33.0  h62c20be_0      anaconda/linux-64       2MB
  + tensorflow-gpu                 1.4.1  0               anaconda/linux-64       3kB
  + tensorflow-gpu-base            1.4.1  py36h01caf0a_0  anaconda/linux-64     119MB
  + tensorflow-tensorboard         1.5.1  py36hf484d3e_1  anaconda/linux-64       3MB
  + tk                            8.6.10  hbc83047_0      anaconda/linux-64       3MB
  + werkzeug                       1.0.1  py_0            anaconda/noarch       249kB
  + wheel                         0.35.1  py_0            anaconda/noarch        37kB
  + xz                             5.2.5  h7b6447c_0      anaconda/linux-64     449kB
  + zipp                           3.3.1  py_0            anaconda/noarch        12kB
  + zlib                          1.2.11  h7b6447c_3      anaconda/linux-64     122kB

  Summary:

  Install: 37 packages

  Total download: 784MB

───────────────────────────────────────────────────────────────────────────────────────
merv
  • 67,214
  • 13
  • 180
  • 245
  • I dont know if this is related enough, but I had a similar issue with ```mamba install -c bioconda perl-bioperl``` where I got the error ```Could not solve for environment specs Encountered problems while solving: - nothing provides perl >=5.22.0,<5.23.0 needed by perl-bioperl-1.6.924-1``` so as you did in your above solution I tried: ```mamba create -n foo -c bioconda python=3.10 perl-bioperl-1.6.924-1``` but this have me an almost identical error: ```Could not solve for environment specs Encountered problems while solving: - nothing provides requested perl-bioperl-1.6.924-1``` – Sky Scraper Feb 07 '23 at 18:56
  • Nevermind, the issue was that I made the environment with python version 3.10 and it is/was/seems like that is compatible. – Sky Scraper Feb 07 '23 at 19:53
  • @SkyScraper The issue looks more like incorrect use of Bioconda. It has very specific instructions that channel priority must be `conda-forge > bioconda > defaults`. Doing only `mamba install -c bioconda` for any package is always wrong. It must be at least `mamba install -c conda-forge -c bioconda`. Or better, configure the channels or use YAML. – merv Feb 07 '23 at 20:12
  • why is that, or where can I read about this specifically? Thanks, sorry – Sky Scraper Feb 07 '23 at 20:14
  • 1
    @SkyScraper [the documentation indicates it](https://bioconda.github.io/#usage). Bioconda builds every package with that channel order, so not following that can lead to unexpected behavior, both in **solving failures** (as you report) because a dependency may only be available through Conda Forge, and in **missing symbol references** (as mentioned in [the Conda Forge docs](https://conda-forge.org/docs/user/tipsandtricks.html#using-multiple-channels)) because different channels use different build stacks. – merv Feb 07 '23 at 20:28