尝试 conda 安装 tensorflow 1.4.1 时发生奇怪的`glibc==2.17` 冲突

Weird `glibc==2.17` conflict when trying to conda install tensorflow 1.4.1

我正在尝试使用以下命令使用 tensorflow (GPU) 版本 1.4.1 创建一个新的 conda 环境 conda create -n parsim_1.4.1 python=3 tensorflow-gpu=1.4.1

然而,它打印出一个奇怪的冲突:

$ 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

我的OS是美分OS7,并且

$ 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

这是怎么回事?我该如何解决?

编辑

感谢@merv 的评论,我尝试使用 Mamba,确实它提供了更好的错误消息(而且速度更快)。如果有人感兴趣,那就是成功安装我所需版本的命令:

mamba create -n parsim python=3 "tensorflow-gpu=1.4" pillow opencv -c shuangnan -c anaconda

Conda 报错。 Mamba 有时更好,在这种特殊情况下它给出:

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

即使在这里,构建字符串中的 py27 也很奇怪,但它至少将我们引导至 cudatoolkit 8.0,它不再托管在 main频道。相反,您需要 。以下对我有用:

$ 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

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