Loading

关于 conda 无法 create 新的 python 3.12 的环境,报错 Solving environment: failed 以及 PackagesNotFoundError

问题

完整错误信息:

virtual-machine:~$ conda create -n llm-mcp-py312 python=3.12
Solving environment: failed

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

  - python=3.11
  - libgcc-ng[version='>=11.2.0']
  - __glibc[version='>=2.17']
  - python=3.11
  - libuuid[version='>=1.41.5,<2.0a0']
  - python=3.11
  - sqlite[version='>=3.40.1,<4.0a0']
  - zlib[version='>=1.2.13,<1.3.0a0']
  - python=3.11
  - xz[version='>=5.2.8,<6.0a0']

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/linux-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/pro/linux-64
  - https://repo.anaconda.com/pkgs/pro/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-forge channel 终于可以了,即在命令中添加 -c conda-forge 参数:

conda create -n llm-mcp-py312 -c conda-forge python=3.12

参考:

posted @ 2025-05-09 16:41  sinatJ  阅读(105)  评论(0)    收藏  举报