anaconda 创建环境失败 解决指南

anaconda 创建环境失败 解决指南

一、问题描述

我在宿舍有一台电脑。由于我经常泡在实验室,所以那台电脑不是经常用,基本吃灰。昨天晚上突然有在那台电脑上使用Camel-AI部署多智能体协同需求,便戳开了电脑,问题也随之而来。

当我运行命令:

conda create -n aa python=3.11

不再像往常那样嘟噜嘟噜地就把环境创建好了,而是给我我大一坨**。

真实纳闷,电脑放久了环境也要出问题

下面是我创建环境的报错:

C:\Users\33132>conda create -n aa python=3.11
Collecting package metadata (current_repodata.json): failed

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "E:\Software\Anaconda\Lib\site-packages\conda\exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      此处省略一万字
      File "E:\Software\Anaconda\Lib\json\decoder.py", line 355, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

`$ E:\Software\Anaconda\Scripts\conda-script.py create -n aa python=3.11`

  environment variables:
                 CIO_TEST=<not set>
                CONDA_EXE=E:\Software\Anaconda\condabin\..\Scripts\conda.exe
               此处省略一万字
          administrator : False
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install <package>

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install <package>

If submitted, this report will be used by core maintainers to improve
future releases of conda.

二、解决指南

运行下面的命令,清除anaconda缓存:

conda clean --all

运行过程中可能会询问你一些是否要删除的问题,一路yesyes就ok。

三、注意事项

我用上述解决了该问题,因此我做笔记在此。如果读者使用此方法不能解决,也挺正常,因为造成这个错误的原因不一定都是缓存的问题。
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_46396470/article/details/143276306