美文网首页
conda create新建环境失败报错

conda create新建环境失败报错

作者: 依然At | 来源:发表于2022-09-17 21:59 被阅读0次

conda create新建环境失败报错:An unexpected error has occurred. Conda has prepared the above report.

问题描述:
在Anaconda Prompt (anaconda3)中使用conda create命令新建环境报错如下:

(base) D:\OneDrive\桌面>conda create -n my_env python==3.8
Collecting package metadata (current_repodata.json): failed

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

    Traceback (most recent call last):
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 259, in _load
        raw_repodata_str = fetch_repodata_remote_request(
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 613, in fetch_repodata_remote_request
        raise Response304ContentUnchanged()
    conda.core.subdir_data.Response304ContentUnchanged

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "D:\anaconda3\lib\site-packages\conda\exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "D:\anaconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "D:\anaconda3\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "D:\anaconda3\lib\site-packages\conda\cli\main_create.py", line 41, in execute
        install(args, parser, 'create')
      File "D:\anaconda3\lib\site-packages\conda\cli\install.py", line 261, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction
        unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff
        final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "D:\anaconda3\lib\site-packages\conda\common\io.py", line 88, in decorated
        return f(*args, **kwds)
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 425, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "D:\anaconda3\lib\site-packages\conda\core\solve.py", line 1020, in _prepare
        reduced_index = get_reduced_index(self.prefix, self.channels,
      File "D:\anaconda3\lib\site-packages\conda\core\index.py", line 276, in get_reduced_index
        new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 120, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "D:\anaconda3\lib\concurrent\futures\_base.py", line 611, in result_iterator
        yield fs.pop().result()
      File "D:\anaconda3\lib\concurrent\futures\_base.py", line 432, in result
        return self.__get_result()
      File "D:\anaconda3\lib\concurrent\futures\_base.py", line 388, in __get_result
        raise self._exception
      File "D:\anaconda3\lib\concurrent\futures\thread.py", line 57, in run
        result = self.fn(*self.args, **self.kwargs)
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 112, in <lambda>
        subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 125, in query
        self.load()
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 189, in load
        _internal_state = self._load()
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 277, in _load
        _internal_state = self._read_local_repdata(mod_etag_headers.get('_etag'),
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 326, in _read_local_repdata
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "D:\anaconda3\lib\site-packages\conda\core\subdir_data.py", line 364, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "D:\anaconda3\lib\json\__init__.py", line 357, in loads
        return _default_decoder.decode(s)
      File "D:\anaconda3\lib\json\decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "D:\anaconda3\lib\json\decoder.py", line 353, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Expecting ',' delimiter: line 420202 column 26 (char 12681108)

`$ D:\anaconda3\Scripts\conda-script.py create -n my_env python==3.8`

  environment variables:
                 CIO_TEST=<not set>
                CLASSPATH=.;D:\Programming Environment\Java\java_8\lib\dt.jar;D:\Programming
                          Environment\Java\java_8\lib\tools.jar;
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=D:\anaconda3\condabin\..\Scripts\conda.exe
               CONDA_EXES="D:\anaconda3\condabin\..\Scripts\conda.exe"
             CONDA_PREFIX=D:\Anaconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=D:\anaconda3\python.exe
               CONDA_ROOT=D:\anaconda3
              CONDA_SHLVL=1
                CUDA_PATH=D:\Mx-yolov3\CUDAv10.0
           CURL_CA_BUNDLE=<not set>
                 HOMEPATH=\Users\MSTIFIY
          NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
                     PATH=D:\anaconda3;D:\anaconda3\Library\mingw-w64\bin;D:\anaconda3\Library\u
                          sr\bin;D:\anaconda3\Library\bin;D:\anaconda3\Scripts;D:\anaconda3\bin;
                          D:\Anaconda3;D:\Anaconda3\Library\mingw-w64\bin;D:\Anaconda3\Library\u
                          sr\bin;D:\Anaconda3\Library\bin;D:\Anaconda3\Scripts;D:\Anaconda3\bin;
                          D:\anaconda3\condabin;D:\Mx-yolov3\CUDAv10.0\bin;D:\Mx-yolov3\CUDAv10.
                          0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS;C:\WINDOWS\sy
                          stem32;C:\WINDOWS\System32;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System3
                          2\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D:\Lauguage
                          Studing\PythonSpider;C:\Program Files
                          (x86)\Google\Chrome\Application\chromedriver;D:\Programming
                          Environment\Java\java_8;D:\Lauguage
                          Studing\Android\Git\Git\cmd;D:\Programming Environment\Tesseract-
                          OCR;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance
                          Toolkit;C:\Program Files (x86)\NVIDIA
                          Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA
                          NvDLISR;D:\Lauguage Studing\Matlab\runtime\win64;D:\Lauguage
                          Studing\Matlab\bin;D:\Lauguage
                          Studing\Matlab\polyspace\bin;D:\Lauguage
                          Studing\opencv3.4.0\opencv\build\x64\vc14\bin;D:\Lauguage Studing\rasp
                          berry\putty;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
                          \WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D
                          :\anaconda3\envs\Mx_yolov3\Scripts;D:\anaconda3\envs\Mx_yolov3;D:\Andr
                          oidSDK;\platform-tools;D:\AndroidSDK;\tools;D:\Tools\cmake-3.21.2-wind
                          ows-x86_64\bin;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS\System32;C:\W
                          INDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WIN
                          DOWS\System32\OpenSSH;D:\Programming
                          Environment\python;D:\Fiddler;D:\Lauguage Studing\鐖櫕\PyCharm
                          Community Edition 2019.3.1\bin;.;D:\Programming
                          Environment\python\Scripts;C:\Program Files
                          (x86)\Google\Chrome\Application;D:\Programming
                          Environment\Java\java_8\bin;D:\Programming
                          Environment\Java\java_8\jre\bin;"D:\Programming
                          Environment\Java\java_8\bin;D:\Mx-yolov3\CUDAv10.0\bin;D:\Mx-yolov3\CU
                          DAv10.0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS;C:\WIND
                          OWS\system32;C:\WINDOWS\System32;C:\WINDOWS\System32\Wbem;C:\WINDOWS\S
                          ystem32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D:\Lauguage
                          Studing\PythonSpider;C:\Program Files
                          (x86)\Google\Chrome\Application\chromedriver;D:\Programming
                          Environment\Java\java_8;D:\Lauguage
                          Studing\Android\Git\Git\cmd;D:\Programming Environment\Tesseract-
                          OCR;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance
                          Toolkit;C:\Program Files (x86)\NVIDIA
                          Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA
                          NvDLISR;D:\Lauguage Studing\Matlab\runtime\win64;D:\Lauguage
                          Studing\Matlab\bin;D:\Lauguage
                          Studing\Matlab\polyspace\bin;D:\Lauguage
                          Studing\opencv3.4.0\opencv\build\x64\vc14\bin;D:\Lauguage Studing\rasp
                          berry\putty;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
                          \WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;D
                          :\anaconda3\envs\Mx_yolov3\Scripts;D:\anaconda3\envs\Mx_yolov3;D:\Andr
                          oidSDK;\platform-tools;D:\AndroidSDK;\tools;D:\Tools\cmake-3.21.2-wind
                          ows-x86_64\bin;";"D:\AndroidSDK;\platform-
                          tools;D:\AndroidSDK;\tools鈥嬧€嬧€嬧€嬧€嬧€嬧€?;D:\Programming
                          Environment\Tesseract-OCR;D:\anaconda3;C:\Users\MSTIFIY\AppData\Local\
                          Microsoft\WindowsApps;D:\Lauguage Studing\miktex\MiKTeX\miktex\bin\x64
             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\Windows
                          PowerShell\v1.0\Modules
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : base
    active env location : D:\Anaconda3
            shell level : 1
       user config file : C:\Users\MSTIFIY\.condarc
 populated config files : C:\Users\MSTIFIY\.condarc
          conda version : 4.9.2
    conda-build version : 3.18.11
         python version : 3.8.3.final.0
       virtual packages : __cuda=10.2=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : D:\anaconda3  (writable)
           channel URLs : https://mirrors.ustc.edu.cn/anaconda/pkgs/main/win-64
                          https://mirrors.ustc.edu.cn/anaconda/pkgs/main/noarch
                          https://mirrors.ustc.edu.cn/anaconda/pkgs/free/win-64
                          https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch
                          https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/win-64
                          https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/noarch
          package cache : D:\anaconda3\pkgs
                          C:\Users\MSTIFIY\.conda\pkgs
                          C:\Users\MSTIFIY\AppData\Local\conda\conda\pkgs
       envs directories : D:\anaconda3\envs
                          C:\Users\MSTIFIY\.conda\envs
                          C:\Users\MSTIFIY\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.9.2 requests/2.24.0 CPython/3.8.3 Windows/10 Windows/10.0.19041
          administrator : False
             netrc file : None
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

[y/N]:

解决方案:
打开.condarc文件:

channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
ssl_verify: true
1
2
3
4
5

删除conda-forge的镜像源

channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
ssl_verify: true
1
2
3
4

再次新建环境,成功。

相关文章

网友评论

      本文标题:conda create新建环境失败报错

      本文链接:https://www.haomeiwen.com/subject/maduortx.html