PackagesNotFoundError: The following packages are not available from current channels python=2.7

新版本conda (4.12 以上的版本) 创建 python 2.x 的环境时, 会提示找不到包.
报错

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: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - python=2.7

Current channels:

  - https://repo.anaconda.com/pkgs/main/osx-arm64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-arm64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

原因
新版本conda 默认channel 中已不能检索不到 python2.x, 可以输入以下命令验证

conda search -f python

旧版是有 2.x 的版本, 但新版没有
PackagesNotFoundError: The following packages are not available from current channels python=2.7_第1张图片

解决方案:
-c 指定channel

conda create -c 'https://repo.continuum.io/pkgs/free/osx-64' -n py2 python=2.7

你可能感兴趣的:(python)