安装新环境和 python 版本时 Conda glibc 依赖冲突

Conda glibc dependency conflict when installing new enviorment and python version

我全新安装了 anaconda3 64 位 python 3.8,我正在尝试使用不同版本的 python 3.9.7

设置 conda env

当我运行conda create -n py39 python=3.9.7 anaconda时显示如下错误:

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.9.7
anaconda -> anaconda-project==0.9.1=pyhd3eb1b0_1 -> python[version='2.7.*|3.5.*|3.6.*|<4.0|>=2.7|>=3.6|>=3.5|>=3.7|>=3|>=3.6,<4.0|>=3.4|>=3.9,<3.10.0a0|>2.7|>=3,<3.7|3.7.*|3.8.*']
anaconda -> python[version='2.7.13|2.7.13|2.7.13|2.7.14|2.7.14|2.7.15|2.7.15|2.7.16|2.7.16|3.6.10|3.6.10|3.7.10|3.9.4|3.8.8|3.7.9|3.8.5|3.7.7|3.8.3|3.8.1|3.7.6|3.7.4|3.6.9|3.6.8|3.7.3|3.6.7|3.7.1|3.7.0|3.6.6|3.6.5|3.5.5|3.6.4|3.5.4|3.6.3|3.5.4|3.6.2|3.5.4|3.6.2|3.5.4|3.6.2|3.5.4|>=3.8,<3.9.0a0|>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0',build='h02fb82a_12|hfff3488_13|h0b30769_14|h417fded_24|hc3d631a_2|hc3d631a_0|h1571d57_0|h0371630_0|h9bab390_0|h265db76_1|h9bab390_7|hcff3b4d_5|h7579374_2|h7579374_1|h7579374_0|hdb3f193_0|hdb3f193_5|hcff3b4d_2|h0371630_0|h0371630_1|h0371630_2|h265db76_0|h0371630_0|h0371630_0|h0371630_7|h9bab390_6|hc3d631a_0|hc3d631a_4|hc3d631a_1|h1571d57_29|hc9025b9_1|he2c66cf_20|hc2b0042_21|hdfe5801_15|h72f0b78_15|heccc3f1_16|hc053d89_14|hac47a24_15|h2170f06_12']The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.23=0
  - feature:|@/linux-64::__glibc==2.23=0

Your installed version is: 2.23

由于 glibc 版本 2.23 和 2.23.0 应该是同一回事,我对如何解决这个问题感到有点困惑?

这与 GLIBC 无关,而是 Anaconda 捆绑包没有任何直接支持 Python v3.9.7 的构建。 Anaconda 的最新版本是 v3.9.4。相反,只需指定次要版本。

conda create -n py39 python=3.9 anaconda

或者,如果您想要更新的 Python,请不要包含 anaconda 并指定您实际计划使用的任何包:

conda create -n py39 python=3.9