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

问题描述:

linux中使用conda create命令新建环境报错如下:

(base) [@localhost SPOT-1D-LM]$ conda create -n spot_1d_lm python=3.7
Collecting package metadata (current_repodata.json): failed

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

    Traceback (most recent call last):
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1080, in __call__
        return func(*args, **kwargs)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/cli/main_create.py", line 41, in execute
        install(args, parser, 'create')
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 259, in install
        unlink_link_transaction = solver.solve_for_transaction(
      File "/home/sunxiaohan/anaconda3/lib/python3.8/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 "/home/sunxiaohan/anaconda3/lib/python3.8/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 "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 425, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 1020, in _prepare
        reduced_index = get_reduced_index(self.prefix, self.channels,
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/index.py", line 288, in get_reduced_index
        new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 140, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "/home/sunxiaohan/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 619, in result_iterator
        yield fs.pop().result()
      File "/home/sunxiaohan/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 444, in result
        return self.__get_result()
      File "/home/sunxiaohan/anaconda3/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
        raise self._exception
      File "/home/sunxiaohan/anaconda3/lib/python3.8/concurrent/futures/thread.py", line 57, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 132, in 
        subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 145, in query
        self.load()
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 210, in load
        _internal_state = self._load()
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 407, in _load
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 480, in _process_raw_repodata_s
tr        json_obj = json.loads(raw_repodata_str or '{}')
      File "/home/sunxiaohan/anaconda3/lib/python3.8/json/__init__.py", line 357, in loads
        return _default_decoder.decode(s)
      File "/home/sunxiaohan/anaconda3/lib/python3.8/json/decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/home/sunxiaohan/anaconda3/lib/python3.8/json/decoder.py", line 353, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 41 (char 40)

`$ /home/sunxiaohan/anaconda3/bin/conda create -n spot_1d_lm python=3.7`

  environment variables:
                 CIO_TEST=
               CMAKE_PATH=/home/sunxiaohan/cmake/bin:
        CMAKE_PREFIX_PATH=/home/sunxiaohan/anaconda3:/home/sunxiaohan/anaconda3/x86_64-conda-
                          linux-gnu/sysroot/usr
      CONDA_BUILD_SYSROOT=/home/sunxiaohan/anaconda3/x86_64-conda-linux-gnu/sysroot
        CONDA_DEFAULT_ENV=base
                CONDA_EXE=/home/sunxiaohan/anaconda3/bin/conda
CONDA_MKL_INTERFACE_LAYER_BACKUP=
             CONDA_PREFIX=/home/sunxiaohan/anaconda3
    CONDA_PROMPT_MODIFIER=(base)
         CONDA_PYTHON_EXE=/home/sunxiaohan/anaconda3/bin/python
               CONDA_ROOT=/home/sunxiaohan/anaconda3
              CONDA_SHLVL=1
       CPLUS_INCLUDE_PATH=/usr/local/include/boost:
           CURL_CA_BUNDLE=
          LD_LIBRARY_PATH=/home/sunxiaohan/softwares/MPFR/lib:/usr/local/lib:/usr/local/cuda-11.
                          3/lib64${LD_LIBRARY_PATH:+:/usr/local/cuda/lib64:}
             LIBRARY_PATH=/usr/local/lib:
              MATLAB_PATH=/home/sunxiaohan/softwares/matlab/bin:
               MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles
                     PATH=/home/sunxiaohan/anaconda3/bin:/home/sunxiaohan/softwares/dionysus/bui
                          ld/bindings/python:/home/sunxiaohan/anaconda3/bin:/home/sunxiaohan/ana
                          conda3/condabin:/usr/local/cuda-11.3/bin:/usr/local/cuda/bin:/usr/loca
                          l/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/sunxiaohan/anaconda3/bi
                          n:/usr/include/boost:/usr/bin/boost:/home/sunxiaohan/.local/bin:/home/
                          sunxiaohan/bin
       REQUESTS_CA_BUNDLE=
            SSL_CERT_FILE=

     active environment : base
    active env location : /home/sunxiaohan/anaconda3
            shell level : 1
       user config file : /home/sunxiaohan/.condarc
 populated config files : /home/sunxiaohan/.condarc
          conda version : 4.11.0
    conda-build version : 3.21.6
         python version : 3.8.12.final.0
       virtual packages : __cuda=11.2=0
                          __linux=3.10.0=0
                          __glibc=2.17=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/sunxiaohan/anaconda3  (writable)
      conda av data dir : /home/sunxiaohan/anaconda3/etc/conda
  conda av metadata url : None
           channel URLs : https://anaconda.org/linux-64
                          https://anaconda.org/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/salilab/linux-64
                          https://conda.anaconda.org/salilab/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/sunxiaohan/anaconda3/pkgs
                          /home/sunxiaohan/.conda/pkgs
       envs directories : /home/sunxiaohan/anaconda3/envs
                          /home/sunxiaohan/.conda/envs
               platform : linux-64
             user-agent : conda/4.11.0 requests/2.26.0 CPython/3.8.12 Linux/3.10.0-957.el7.x86_64 centos/7.9.2009 glibc/2.17
                UID:GID : 1006:1006
             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]: y
Upload did not complete.

Thank you for helping to improve conda.
Opt-in to always sending reports (and not see this message again)
by running

    $ conda config --set report_errors true

解决方案:

1. 打开.condarc文件:vim ~/.condarc

2. 删除conda-forge的镜像源,再次创建成功

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/
show_channel_urls: true

channels:

  - https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
show_channel_urls: true

你可能感兴趣的:(linux小问题,conda,python,开发语言)