跨境派

跨境派

跨境派,专注跨境行业新闻资讯、跨境电商知识分享!

当前位置:首页 > 卖家故事 > 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

时间:2024-04-21 13:45:20 来源:网络cs 作者:胡椒 栏目:卖家故事 阅读:

标签: 系列  记录 
阅读本书更多章节>>>>

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二. conda install安装不了任何包,报一大段错误报错解决办法: 三. Conda无法安装或更新的问题解决办法 四. CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/




一. 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 : FalseAn unexpected error has occurred. Conda has prepared the above report.If submitted, this report will be used by core maintainers to improvefuture releases of conda.Would you like conda to send this report to the core maintainers?[y/N]: yUpload 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 deeptoolsCollecting package metadata (current_repodata.json): failedCondaHTTPError: 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 ~/.condarcchannels:  - 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 xlwtCollecting 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 improvefuture 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

完美解决!!

在这里插入图片描述

详情见 三. 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 numpyCollecting 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 improvefuture 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

修改前:

在这里插入图片描述
修改后:

在这里插入图片描述

然后就可以了!

看网上有人说,把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.kjpai.cn/gushi/2024-04-21/160931.html,文章来源:网络cs,作者:胡椒,版权归作者所有,如需转载请注明来源和作者,否则将追究法律责任!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。

文章评论