Python&aconda系列:conda踩坑记录1.An unexpected error has occurred. Conda has prepared the above report

这篇具有很好参考价值的文章主要介绍了Python&aconda系列:conda踩坑记录1.An unexpected error has occurred. Conda has prepared the above report。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。



一. conda踩坑记录1.An unexpected error has occurred. Conda has prepared the above report

想更新deeptools,但是发现无论如何都下载不了,并且有以下报错

(atac) vip9t07@tpm9-desktop:~/project/atac/new$ conda update -n atac deeptools 
Collecting package metadata (current_repodata.json): failed

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

    Traceback (most recent call last):
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 375, in _load
        repodata_fn=self.repodata_fn)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 808, 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 "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
        return getattr(module, func_name)(args, parser)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/cli/main_update.py", line 20, in execute
        install(args, parser, 'update')
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/cli/install.py", line 265, in install
        should_retry_solve=(_should_retry_unfrozen or repodata_fn != repodata_fns[-1]),
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 117, in solve_for_transaction
        should_retry_solve)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 158, in solve_for_diff
        force_remove, should_retry_solve)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 425, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 1021, in _prepare
        self.subdirs, prepared_specs, self._repodata_fn)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 289, in get_reduced_index
        repodata_fn=repodata_fn)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 140, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "/home/data/vip9t07/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 556, in result_iterator
        yield future.result()
      File "/home/data/vip9t07/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 398, in result
        return self.__get_result()
      File "/home/data/vip9t07/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 357, in __get_result
        raise self._exception
      File "/home/data/vip9t07/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 55, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 133, in <lambda>
        package_ref_or_match_spec))
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 145, in query
        self.load()
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 209, in load
        _internal_state = self._load()
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 390, in _load
        mod_etag_headers.get('_mod'))
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 438, in _read_local_repdata
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 476, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "/home/data/vip9t07/miniconda3/lib/python3.6/json/__init__.py", line 354, in loads
        return _default_decoder.decode(s)
      File "/home/data/vip9t07/miniconda3/lib/python3.6/json/decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/home/data/vip9t07/miniconda3/lib/python3.6/json/decoder.py", line 355, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Unterminated string starting at: line 150276 column 17 (char 4718399)

`$ /home/data/vip9t07/miniconda3/bin/conda update -n atac deeptools`

  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=atac
                CONDA_EXE=/home/data/vip9t07/miniconda3/bin/conda
             CONDA_PREFIX=/home/data/vip9t07/miniconda3/envs/atac
           CONDA_PREFIX_1=/home/data/vip9t07/miniconda3
    CONDA_PROMPT_MODIFIER=(atac)
         CONDA_PYTHON_EXE=/home/data/vip9t07/miniconda3/bin/python
               CONDA_ROOT=/home/data/vip9t07/miniconda3
              CONDA_SHLVL=2
           CURL_CA_BUNDLE=<not set>
     JAVA_LD_LIBRARY_PATH=/home/data/vip9t07/miniconda3/envs/atac/lib/server
                     PATH=/home/data/vip9t07/miniconda3/bin:/home/data/vip9t07/miniconda3/envs/a
                          tac/bin:/home/data/vip9t07/miniconda3/condabin:/usr/local/sbin:/usr/lo
                          cal/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sna
                          p/bin:/home/data/vip9t07/biosoft/bowtie2/bowtie2-2.4.2-linux-x86_64:/h
                          ome/data/vip9t07/biosoft/samtools/samtools-1.12
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : atac
    active env location : /home/data/vip9t07/miniconda3/envs/atac
            shell level : 2
       user config file : /home/data/vip9t07/.condarc
 populated config files : /home/data/vip9t07/.condarc
          conda version : 4.10.1
    conda-build version : not installed
         python version : 3.6.2.final.0
       virtual packages : __linux=5.8.0=0
                          __glibc=2.31=0
                          __unix=0=0
                          __archspec=1=x86_64
       base environment : /home/data/vip9t07/miniconda3  (writable)
      conda av data dir : /home/data/vip9t07/miniconda3/etc/conda
  conda av metadata url : https://repo.anaconda.com/pkgs/main
           channel URLs : https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/linux-64
                          https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/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/data/vip9t07/miniconda3/pkgs
                          /home/data/vip9t07/.conda/pkgs
       envs directories : /home/data/vip9t07/miniconda3/envs
                          /home/data/vip9t07/.conda/envs
               platform : linux-64
             user-agent : conda/4.10.1 requests/2.25.1 CPython/3.6.2 Linux/5.8.0-50-generic ubuntu/20.04.2 glibc/2.31
                UID:GID : 1012:1014
             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 successful.

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

按照二. conda install安装不了任何包,报一大段错误
方法,还是不行,并且出现了新的报错

(atac) vip9t07@tpm9-desktop:~/project/atac/new$ conda clean -i
(atac) vip9t07@tpm9-desktop:~/project/atac/new$ conda install -c bioconda deeptools
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch'

继续找解决办法
Python&aconda系列:conda创建虚拟环境、切换环境 报错中的`三. conda create, conda install, conda update报错

(atac) vip9t07@tpm9-desktop:~$ conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
(atac) vip9t07@tpm9-desktop:~$ conda config --set show_channel_urls yes

光删除了conda-forge的镜像源依然不能解决问题

继续

四. CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda

将中科大的镜像源加入并删除其他清华镜像源及default

(atac) vip9t07@tpm9-desktop:~$ vim ~/.condarc
(atac) vip9t07@tpm9-desktop:~$ cat ~/.condarc
channels:
  - https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
  - https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
show_channel_urls: true

可以了!
(当然这只是我以为的可以了,实际上后续还经历了一系列醉生梦死的艰辛求知路……)



二. conda install安装不了任何包,报一大段错误

报错

(ywx_pytorch_env) C:\Users\1>conda install xlwt
Collecting package metadata (current_repodata.json): failed
 
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
 
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 251, in _load
        raise UnavailableInvalidChannel(self.url_w_repodata_fn, 404)
    conda.exceptions.UnavailableInvalidChannel: The channel is not accessible or is invalid.
      channel name: anaconda/pkgs/free
      channel url: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
      error code: 404
 
    You will need to adjust your conda configuration to proceed.
    Use `conda config --show channels` to view your configuration's current state,
    and use `conda config --show-sources` to view config file locations.
 
 
    During handling of the above exception, another exception occurred:
 
    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 248, in _load
        repodata_fn=self.repodata_fn)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 598, 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 "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\exceptions.py", line 1078, in __call__
        return func(*args, **kwargs)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\cli\conda_argparse.py", line 82, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\cli\main_install.py", line 20, in execute
        install(args, parser, 'install')
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\cli\install.py", line 265, in install
        should_retry_solve=(_should_retry_unfrozen or repodata_fn != repodata_fns[-1]),
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\solve.py", line 117, in solve_for_transaction
        should_retry_solve)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\solve.py", line 158, in solve_for_diff
        force_remove, should_retry_solve)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\common\io.py", line 88, in decorated
        return f(*args, **kwds)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\solve.py", line 415, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\solve.py", line 1004, in _prepare
        self.subdirs, prepared_specs, self._repodata_fn)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\index.py", line 229, in get_reduced_index
        repodata_fn=repodata_fn)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 105, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\concurrent\futures\_base.py", line 586, in result_iterator
        yield fs.pop().result()
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\concurrent\futures\_base.py", line 425, in result
        return self.__get_result()
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\concurrent\futures\_base.py", line 384, in __get_result
        raise self._exception
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\concurrent\futures\thread.py", line 56, in run
        result = self.fn(*self.args, **self.kwargs)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 98, in <lambda>
        package_ref_or_match_spec))
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 110, in query
        self.load()
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 174, in load
        _internal_state = self._load()
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 255, in _load
        return self._load()
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 263, in _load
        mod_etag_headers.get('_mod'))
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 311, in _read_local_repdata
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\conda\core\subdir_data.py", line 349, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\json\__init__.py", line 354, in loads
        return _default_decoder.decode(s)
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\json\decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\json\decoder.py", line 355, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Unterminated string starting at: line 78753 column 5 (char 2031407)
 
`$ C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\Scripts\conda-script.py install xlwt`
 
  environment variables:
                 CIO_TEST=<not set>
        CONDA_DEFAULT_ENV=ywx_pytorch_env
                CONDA_EXE=C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\condabin\..\Scripts\cond
                          a.exe
               CONDA_EXES="C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\condabin\..\Scripts\con
                          da.exe"
             CONDA_PREFIX=C:\ProgramData\Anaconda3\envs\ywx_pytorch_env
           CONDA_PREFIX_1=C:\ProgramData\Anaconda3
    CONDA_PROMPT_MODIFIER=(ywx_pytorch_env)
         CONDA_PYTHON_EXE=C:\ProgramData\Anaconda3\python.exe
               CONDA_ROOT=C:\ProgramData\Anaconda3\envs\ywx_pytorch_env
              CONDA_SHLVL=2
            CUDA_BIN_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin
            CUDA_LIB_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64
                CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
        CUDA_SDK_BIN_PATH=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\bin\win64
        CUDA_SDK_LIB_PATH=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\common\lib\x64
            CUDA_SDK_PATH=C:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0
                 HOMEPATH=\Users\ywx
          NVTOOLSEXT_PATH=C:\Program Files\NVIDIA Corporation\NvToolsExt\
                     PATH=C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\lib\site-packages\pywin3
                          2_system32;C:\ProgramData\Anaconda3\envs\ywx_pytorch_env;C:\ProgramDat
                          a\Anaconda3\envs\ywx_pytorch_env\Library\mingw-w64\bin;C:\ProgramData\
                          Anaconda3\envs\ywx_pytorch_env\Library\usr\bin;C:\ProgramData\Anaconda
                          3\envs\ywx_pytorch_env\Library\bin;C:\ProgramData\Anaconda3\envs\ywx_p
                          ytorch_env\Scripts;C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\bin;C
                          :\ProgramData\Anaconda3\envs\ywx_pytorch_env;C:\ProgramData\Anaconda3\
                          envs\ywx_pytorch_env\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\en
                          vs\ywx_pytorch_env\Library\usr\bin;C:\ProgramData\Anaconda3\envs\ywx_p
                          ytorch_env\Library\bin;C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\S
                          cripts;C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\bin;C:\ProgramDat
                          a\Anaconda3\condabin;D:\tools\Python\Python35\Scripts;D:\tools\Python\
                          Python35;C:\Program Files (x86)\Common
                          Files\Oracle\Java\javapath;C:\Program Files\NVIDIA GPU Computing
                          Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CU
                          DA\v9.0\libnvvp;C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Libr
                          ary\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramD
                          ata\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\xw;C:\xw
                          \Library\mingw-w64\bin;C:\xw\Library\usr\bin;C:\xw\Library\bin;C:\xw\S
                          cripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Wind
                          ows\System32\WindowsPowerShell\v1.0;C:\Program
                          Files\MATLAB\R2014b\runtime\win64;C:\Program
                          Files\MATLAB\R2014b\bin;C:\Program
                          Files\MATLAB\R2014b\polyspace\bin;C:\Program Files (x86)\NVIDIA Corpor
                          ation\PhysX\Common;C:\Users\ykm\software\MEGA-X;C:\WINDOWS\system32;C:
                          \WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShel
                          l\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\NVIDIA GPU
                          Computing Toolkit\CUDA\v9.0;C:\Program Files\NVIDIA GPU Computing
                          Toolkit\CUDA\v9.0\lib\x64;C:\Program Files\MySQL\MySQL Server
                          8.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras
                          \CUPTI\libx64;D:\vs2015\Common7\Tools;D:\Visual Studio 2015 缁犫偓娴f挷绗撴稉姘
                          卞\VC\bin\x86_amd64;F:\zx\wangyutaosrt\Git\bin;D:\tools\Git\cmd;D:\Vis
                          ual Studio 2015 缁犫偓娴f挷绗撴稉姘卞\VC\bin;C:\Program Files (x86)\Windows
                          Kits\8.1\Windows Performance
                          Toolkit;C:\Users\ywx\AppData\Local\Microsoft\WindowsApps;.
             PSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\Windows
                          PowerShell\v1.0\Modules
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>
    VBOX_MSI_INSTALL_PATH=C:\Users\cxj\vbox\
 
     active environment : base
    active env location : C:\ProgramData\Anaconda3\envs\ywx_pytorch_env
            shell level : 2
       user config file : C:\Users\ywx\.condarc
 populated config files : C:\Users\ywx\.condarc
          conda version : 4.8.0
    conda-build version : 3.18.11
         python version : 3.6.9.final.0
       virtual packages : __cuda=10.1
       base environment : C:\ProgramData\Anaconda3\envs\ywx_pytorch_env  (writable)
           channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\pkgs
                          C:\Users\ywx\.conda\pkgs
                          C:\Users\ywx\AppData\Local\conda\conda\pkgs
       envs directories : C:\ProgramData\Anaconda3\envs\ywx_pytorch_env\envs
                          C:\Users\ywx\.conda\envs
                          C:\Users\ywx\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.8.0 requests/2.22.0 CPython/3.6.9 Windows/10 Windows/10.0.18362
          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]: n
 
No report sent. To permanently opt-out, use
 
    $ conda config --set report_errors false

解决办法:

1、有人说是防火墙的问题,输入conda config --set ssl_verify false

还是不行

2、有人说conda损坏,重装,,,,想想还是算了,太麻烦

3、终极解决办法:输入 conda clean -i

完美解决!!

an unexpected error has occurred. conda has prepared the above report. if yo,# python,python,conda,人工智能

详情见 三. Conda无法安装或更新的问题



三. Conda无法安装或更新的问题

用conda安装任何东西都报错. 开始怀疑是公司的鬼网络问题.

.condarc重命名, 重新尝试, 一切又很正常, 以为是清华源TUNA的问题, 还想去https://github.com/tuna/ 报错.

后来一次将https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r channel一行在.condarc中删掉后, 一切又正常了. 莫名其妙啊…

最开始时怀疑是 raise UnavailableInvalidChannel(self.url_w_repodata_fn, 404)的问题, 以为是清华源那边缺失channeldata.json导致找不到subdir, 但关键的文件是repodata.json还是存在且一样的. 可能不是TUNA的问题.

  • 官方pkgs/r源 https://repo.anaconda.com/pkgs/r

  • 清华pkgs/r源 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r/

于是重新仔细追查错误, 发现这个错误有三处:

  • raise UnavailableInvalidChannel(self.url_w_repodata_fn, 404)

  • raise Response304ContentUnchanged()

  • json.decoder.JSONDecodeError: Unterminated string starting at: line 184947 column 5 (char 5586731)

第一个网络是可以下载对应repodata.json的, 第二个304重定向应该不是, 第三个是json解码的问题. 搜了一下, 找到以下帖子:

JSONDecodeError with on-disk corrupted repodata #7190

噢, 原来还是公司网络的锅. 肯定是之前update repo信息时网络有问题, 于是就出现了污染.

解决办法

conda clean -i

然后重新随便install 个东西, 会重新下载repo信息. 问题解决. NND的公司网络…

附错误内容:

$ conda install numpy
Collecting package metadata (current_repodata.json): failed

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

    Traceback (most recent call last):
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 251, in _load
        raise UnavailableInvalidChannel(self.url_w_repodata_fn, 404)
    conda.exceptions.UnavailableInvalidChannel: The channel is not accessible or is invalid.
      channel name: anaconda/pkgs/r
      channel url: https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
      error code: 404

    You will need to adjust your conda configuration to proceed.
    Use `conda config --show channels` to view your configuration's current state,
    and use `conda config --show-sources` to view config file locations.


    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 248, in _load
        repodata_fn=self.repodata_fn)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 598, 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 "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/exceptions.py", line 1079, in __call__
        return func(*args, **kwargs)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/cli/main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/cli/conda_argparse.py", line 82, in do_call
        return getattr(module, func_name)(args, parser)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/cli/main_install.py", line 20, in execute
        install(args, parser, 'install')
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/cli/install.py", line 265, in install
        should_retry_solve=(_should_retry_unfrozen or repodata_fn != repodata_fns[-1]),
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 117, in solve_for_transaction
        should_retry_solve)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 158, in solve_for_diff
        force_remove, should_retry_solve)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 262, in solve_final_state
        ssc = self._collect_all_metadata(ssc)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/common/io.py", line 88, in decorated
        return f(*args, **kwds)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 415, in _collect_all_metadata
        index, r = self._prepare(prepared_specs)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/solve.py", line 1011, in _prepare
        self.subdirs, prepared_specs, self._repodata_fn)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/index.py", line 228, in get_reduced_index
        repodata_fn=repodata_fn)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 105, in query_all
        result = tuple(concat(executor.map(subdir_query, channel_urls)))
      File "/home/hom/Softwares/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 586, in result_iterator
        yield fs.pop().result()
      File "/home/hom/Softwares/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 425, in result
        return self.__get_result()
      File "/home/hom/Softwares/miniconda3/lib/python3.6/concurrent/futures/_base.py", line 384, in __get_result
        raise self._exception
      File "/home/hom/Softwares/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 56, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 98, in <lambda>
        package_ref_or_match_spec))
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 110, in query
        self.load()
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 174, in load
        _internal_state = self._load()
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 255, in _load
        return self._load()
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 263, in _load
        mod_etag_headers.get('_mod'))
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 311, in _read_local_repdata
        _internal_state = self._process_raw_repodata_str(raw_repodata_str)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/site-packages/conda/core/subdir_data.py", line 349, in _process_raw_repodata_str
        json_obj = json.loads(raw_repodata_str or '{}')
      File "/home/hom/Softwares/miniconda3/lib/python3.6/json/__init__.py", line 354, in loads
        return _default_decoder.decode(s)
      File "/home/hom/Softwares/miniconda3/lib/python3.6/json/decoder.py", line 339, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/home/hom/Softwares/miniconda3/lib/python3.6/json/decoder.py", line 355, in raw_decode
        obj, end = self.scan_once(s, idx)
    json.decoder.JSONDecodeError: Unterminated string starting at: line 184947 column 5 (char 5586731)

# 这里省去一堆本地参数

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]:
Timeout reached. No report sent.


四. CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64/current_repodata.json>
Elapsed: -
 
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
'https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64'

原因:连不上清华的镜像。

按照网上的方法删除 -default 也没有用。

修改方法:

使用下面两个命令,将中科大的镜像加到目录中去

$conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
$conda config --set show_channel_urls yes

然后打开./删除其他所有镜像,以及default

$vim ~/.condarc

修改前:

an unexpected error has occurred. conda has prepared the above report. if yo,# python,python,conda,人工智能
修改后:

an unexpected error has occurred. conda has prepared the above report. if yo,# python,python,conda,人工智能

然后就可以了!

看网上有人说,把https 改为http也行,没试,不知道可行否









Evan Yi

conda install安装不了任何包,报一大段错误

爱折腾的大懒猪

Conda无法安装或更新的问题

titake

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/

小狼小狼_e211

conda踩坑记录1.An unexpected error has occurred. Conda has prepared the above report.文章来源地址https://www.toymoban.com/news/detail-851825.html

到了这里,关于Python&aconda系列:conda踩坑记录1.An unexpected error has occurred. Conda has prepared the above report的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • An unexpected connection driver error occured

    安装下载好rabbitmq,我在springboot整合mq,启动的时候报错了 An unexpected connection driver error occured 后来又报 Failed to check/redeclare auto-delete queue(s). 综合就是连接问题,端口有问题 我试过添加账户,提高权限,都没用,参考了 https://blog.csdn.net/weixin_43933728/article/details/124691726 最后发

    2024年02月11日
    浏览(75)
  • yarn报错 error An unexpected error occurred httpsregistry.yarnpkg.com...

    1. 报错原因 使用yarn命令安装依赖包时报错,提示信息: error An unexpected error occurred: \\\"https://registry.yarnpkg.com/killable/-/killable-1.0.0.tgz: connect ETIMEDOUT 104.16.19.35:443\\\" 这是由于资源地址请求超时造成的,需要更换一下请求地址。 2. 解决方案 将资源地址设置为淘宝镜像: 查看当前镜像

    2024年02月12日
    浏览(55)
  • 解决方案:yarn 出现error An unexpected error occurred错误的解决办法

    yarn 相比于 npm 、 cnpm 、 npx 来说,效率很高,是前端工程师首选的 包管理 工具,但今日在项目中遇到一个问题,让人很是头疼,看一下报错: 网上搜索解决方案,查阅了一下yarn官方文档,查找到一种解决方法 相信出现类似的情况,会帮助到大家!!!

    2024年02月05日
    浏览(102)
  • There was an unexpected error (type=Internal Server Error, status=500).

    There was an unexpected error (type=Internal Server Error, status=500). org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: “class path resource [templates/main.html]”) 这个错误原因在于模板上的有些数据异常导致的: 问题描述 在开发springboot的时候,进行modelAndView 视图层

    2024年02月09日
    浏览(50)
  • Docker Desktop-Unexpected WSL error An unexpected error was encountered while executing a WSL comman

    windows安装docker报错: Docker Desktop - Unexpected WSL error An unexpected error was encountered while executing a WSL command. Common causes include access rights issues, which occur after waking the computer or not being connected to your domain/active directory. Please try shutting WSL down (wl --shutdown) and/or rebooting your computer. If not suff

    2024年03月10日
    浏览(68)
  • Java连rabbitMQ 报错 An unexpected connection driver error occured

    Java 项目中连接不上 rabbitMQ,报错内容如下 An unexpected connection driver error occured   是 发生意外的连接驱动程序错误 最大的可能是 新建的用户 没有 授权 一、 要确认  服务器安装上mq之后默认端口15672是浏览器浏览的端口,项目中则是需要配置成5672 二、新建用户需要授权 

    2024年02月12日
    浏览(57)
  • There was an unexpected error (type=Bad Request, status=400).

    本来是在学习@RequestParam 这个注解,前后端代码完善后就在浏览器里进行了测试,结果报了 400 的错。 前端的请求链接如下: 首先得知道 400 这个状态码是啥意思:400 ,bad request意思是“错误的请求\\\"; 所以是请求方式有问题吗? 我寻思这里的GET请求也是符合URL语法的,所以

    2024年02月13日
    浏览(57)
  • rabbitmq连接特别慢 一直连接超时 An unexpected connection driver error occured

    连接linux上的rabbitmq时,特别慢一直出现An unexpected connection driver error occured 或者 连接超时等异常。如下: 造成这个问题的原因大概有三种: 一、配置文件rabbitmq端口号错误,端口后应该写成5672   二、权限问题,登录rabbitmq,查看用户权限。如下: 像这个shop一样就可以了,如

    2024年02月15日
    浏览(46)
  • error An unexpected error occurred: “https://registry.npmmirror.com/moment: tunneling socket could n

    yarn install 的时候报了错误 解决方法 我换了原来的镜像 yarn 不行就换npm,确保都换了,然后这个报错就可以解决了 如果还不行的,检查你的代理地址是否正确,是否防火墙影响

    2024年02月04日
    浏览(46)
  • conda 解决An HTTP error occurred when trying to retrieve this URL

    有以下几种可能的解决方案: 更换清华源 :可以把清华源的 URL 添加到 Anaconda 的默认通道中,这样就可以从国内的镜像下载安装包。 修改 SSL 验证 :可以在命令行中输入 conda config --set ssl_verify false 或者在 .condarc 文件中添加一行 ssl_verify: false 来关闭 SSL 验证,这样就可以避

    2024年01月17日
    浏览(52)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包