【报错】Anaconda Collecting package metadata (repodata.json): failed

2023-10-24 02:40

本文主要是介绍【报错】Anaconda Collecting package metadata (repodata.json): failed,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1. 报错原因

我想卸载python,然后报错如下。

(ptc) C:\Users\Lion>conda uninstall python
Collecting package metadata (repodata.json): failed# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<Traceback (most recent call last):File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 244, in _loadraw_repodata_str = fetch_repodata_remote_request(File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 598, in fetch_repodata_remote_requestraise Response304ContentUnchanged()conda.core.subdir_data.Response304ContentUnchangedDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\exceptions.py", line 1079, in __call__return func(*args, **kwargs)File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\cli\main.py", line 84, in _mainexit_code = do_call(args, p)File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\cli\conda_argparse.py", line 83, in do_callreturn getattr(module, func_name)(args, parser)File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\cli\main_remove.py", line 89, in executetxn = solver.solve_for_transaction()File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transactionunlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\solve.py", line 157, in solve_for_difffinal_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\solve.py", line 262, in solve_final_statessc = self._collect_all_metadata(ssc)File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\common\io.py", line 88, in decoratedreturn f(*args, **kwds)File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\solve.py", line 425, in _collect_all_metadataindex, r = self._prepare(prepared_specs)File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\solve.py", line 1020, in _preparereduced_index = get_reduced_index(self.prefix, self.channels,File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\index.py", line 227, in get_reduced_indexnew_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 105, in query_allresult = tuple(concat(executor.map(subdir_query, channel_urls)))File "D:\ProgramFiles\Anaconda\lib\concurrent\futures\_base.py", line 611, in result_iteratoryield fs.pop().result()File "D:\ProgramFiles\Anaconda\lib\concurrent\futures\_base.py", line 439, in resultreturn self.__get_result()File "D:\ProgramFiles\Anaconda\lib\concurrent\futures\_base.py", line 388, in __get_resultraise self._exceptionFile "D:\ProgramFiles\Anaconda\lib\concurrent\futures\thread.py", line 57, in runresult = self.fn(*self.args, **self.kwargs)File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 97, in <lambda>subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 110, in queryself.load()File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 174, in load_internal_state = self._load()File "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 262, in _load_internal_state = self._read_local_repdata(mod_etag_headers.get('_etag'),File "D:\ProgramFiles\Anaconda\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 "D:\ProgramFiles\Anaconda\lib\site-packages\conda\core\subdir_data.py", line 349, in _process_raw_repodata_strjson_obj = json.loads(raw_repodata_str or '{}')File "D:\ProgramFiles\Anaconda\lib\json\__init__.py", line 357, in loadsreturn _default_decoder.decode(s)File "D:\ProgramFiles\Anaconda\lib\json\decoder.py", line 337, in decodeobj, end = self.raw_decode(s, idx=_w(s, 0).end())File "D:\ProgramFiles\Anaconda\lib\json\decoder.py", line 353, in raw_decodeobj, end = self.scan_once(s, idx)json.decoder.JSONDecodeError: Unterminated string starting at: line 781976 column 7 (char 22331207)`$ D:\ProgramFiles\Anaconda\Scripts\conda-script.py uninstall python\`environment variables:CIO_TEST=<not set>CONDA_DEFAULT_ENV=ContinualRECONDA_EXE=D:\ProgramFiles\Anaconda\condabin\..\Scripts\conda.exeCONDA_EXES="D:\ProgramFiles\Anaconda\condabin\..\Scripts\conda.exe"CONDA_PREFIX=D:\ProgramFiles\Anaconda\envs\ContinualRECONDA_PREFIX_1=D:\ProgramFiles\AnacondaCONDA_PROMPT_MODIFIER=(ContinualRE)CONDA_PYTHON_EXE=D:\ProgramFiles\Anaconda\python.exeCONDA_ROOT=D:\ProgramFiles\AnacondaCONDA_SHLVL=2CURL_CA_BUNDLE=<not set>HOMEPATH=\Users\LionPATH=D:\ProgramFiles\Anaconda;D:\ProgramFiles\Anaconda\Library\mingw-w64\bin;D:\ProgramFiles\Anaconda\Library\usr\bin;D:\ProgramFiles\Anaconda\Library\bin;D:\ProgramFiles\Anaconda\Scripts;D:\ProgramFiles\Anaconda\bin;D:\ProgramFiles\Anaconda\envs\ContinualRE;D:\ProgramFiles\Anaconda\envs\ContinualRE\Library\mingw-w64\bin;D:\ProgramFiles\Anaconda\envs\ContinualRE\Library\usr\bin;D:\ProgramFiles\Anaconda\envs\ContinualRE\Library\bin;D:\ProgramFiles\Anaconda\envs\ContinualRE\Scripts;D:\ProgramFiles\Anaconda\envs\ContinualRE\bin;D:\ProgramFiles\Anaconda\condabin;.;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;D:\ProgramFiles\Git\cmd;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\Lion\AppData\Local\Microsoft\WindowsApps;.;D:\ProgramFiles\Microsoft VS Code\bin;C:\ProgramFiles\Intel\WiFi\bin;C:\Program Files\CommonFiles\Intel\WirelessCommon;D:\ProgramFiles\BandizipPSMODULEPATH=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\ModulesREQUESTS_CA_BUNDLE=<not set>SSL_CERT_FILE=<not set>active environment : ContinualREactive env location : D:\ProgramFiles\Anaconda\envs\ContinualREshell level : 2user config file : C:\Users\Lion\.condarcpopulated config files : C:\Users\Lion\.condarcconda version : 4.8.5conda-build version : 3.18.11python version : 3.8.3.final.0virtual packages : __cuda=8.0base environment : D:\ProgramFiles\Anaconda  (writable)channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarchhttps://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarchhttps://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarchhttps://repo.anaconda.com/pkgs/main/win-64https://repo.anaconda.com/pkgs/main/noarchhttps://repo.anaconda.com/pkgs/r/win-64https://repo.anaconda.com/pkgs/r/noarchhttps://repo.anaconda.com/pkgs/msys2/win-64https://repo.anaconda.com/pkgs/msys2/noarchpackage cache : D:\ProgramFiles\Anaconda\pkgsC:\Users\Lion\.conda\pkgsC:\Users\Lion\AppData\Local\conda\conda\pkgsenvs directories : D:\ProgramFiles\Anaconda\envsC:\Users\Lion\.conda\envsC:\Users\Lion\AppData\Local\conda\conda\envsplatform : win-64user-agent : conda/4.8.5 requests/2.24.0 CPython/3.8.3 Windows/10 Windows/10.0.19041administrator : Falsenetrc file : Noneoffline mode : FalseAn 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]:No report sent. To permanently opt-out, use$ conda config --set report_errors false

2. 原因

镜像源错误。
首先执行:

conda clean -i

然后,在C:\Users\YOUR USER NAME找到.condarc;

然后把其中的内容替换成:

channels:- defaults
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudmsys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudbioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudmenpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudpytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloudsimpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud

保存。

最后,执行卸载Python操作,成功!

参考感谢!

[1] conda常见报错以及解决方法【持续更新conda的其它报错以及解决方法。】
[2] 清华大学镜像站

https://www.codeleading.com/article/55094760021/

以上是作者的内容的链接。

在自己的电脑上安装Anaconda时,我遇到了几个问题记录下:

1. 安装Anaconda需要选择Just me

2. 创建虚拟环境出现问题

我按照上面的方法试了之后还是出现这样的问题,最后我关闭了代理才成功,真的让我匪夷所思。

这篇关于【报错】Anaconda Collecting package metadata (repodata.json): failed的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/272169

相关文章

Anaconda 中遇到CondaHTTPError: HTTP 404 NOT FOUND for url的问题及解决办法

最近在跑一个开源项目遇到了以下问题,查了很多资料都大(抄)同(来)小(抄)异(去)的,解决不了根本问题,费了很大的劲终于得以解决,记录如下: 1、问题及过程: (myenv) D:\Workspace\python\XXXXX>conda install python=3.6.13 Solving environment: done.....Proceed ([y]/n)? yDownloa

Jenkins 插件 地址证书报错问题解决思路

问题提示摘要: SunCertPathBuilderException: unable to find valid certification path to requested target...... 网上很多的解决方式是更新站点的地址,我这里修改了一个日本的地址(清华镜像也好),其实发现是解决不了上述的报错问题的,其实,最终拉去插件的时候,会提示证书的问题,几经周折找到了其中一遍博文

【Python报错已解决】AttributeError: ‘list‘ object has no attribute ‘text‘

🎬 鸽芷咕:个人主页  🔥 个人专栏: 《C++干货基地》《粉丝福利》 ⛺️生活的理想,就是为了理想的生活! 文章目录 前言一、问题描述1.1 报错示例1.2 报错分析1.3 解决思路 二、解决方法2.1 方法一:检查属性名2.2 步骤二:访问列表元素的属性 三、其他解决方法四、总结 前言 在Python编程中,属性错误(At

php中json_decode()和json_encode()

1.json_decode() json_decode (PHP 5 >= 5.2.0, PECL json >= 1.2.0) json_decode — 对 JSON 格式的字符串进行编码 说明 mixed json_decode ( string $json [, bool $assoc ] ) 接受一个 JSON 格式的字符串并且把它转换为 PHP 变量 参数 json

DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed

DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed 文章目录 DBeaver 连接 MySQL 报错 Public Key Retrieval is not allowed问题解决办法 问题 使用 DBeaver 连接 MySQL 数据库的时候, 一直报错下面的错误 Public Key Retrieval is

struts2中的json返回指定的多个参数

要返回指定的多个参数,就必须在struts.xml中的配置如下: <action name="goodsType_*" class="goodsTypeAction" method="{1}"> <!-- 查询商品类别信息==分页 --> <result type="json" name="goodsType_findPgae"> <!--在这一行进行指定,其中lis是一个List集合,但

vue 父组件调用子组件的方法报错,“TypeError: Cannot read property ‘subDialogRef‘ of undefined“

vue 父组件调用子组件的方法报错,“TypeError: Cannot read property ‘subDialogRef’ of undefined” 最近用vue做的一个界面,引入了一个子组件,在父组件中调用子组件的方法时,报错提示: [Vue warn]: Error in v-on handler: “TypeError: Cannot read property ‘methods

ORACLE语法-包(package)、存储过程(procedure)、游标(cursor)以及java对Result结果集的处理

陈科肇 示例: 包规范 CREATE OR REPLACE PACKAGE PACK_WMS_YX IS-- Author : CKZ-- Created : 2015/8/28 9:52:29-- Purpose : 同步数据-- Public type declarations,游标 退休订单TYPE retCursor IS REF CURSOR;-- RETURN vi_co_co

android java.io.IOException: open failed: ENOENT (No such file or directory)-api23+权限受权

问题描述 在安卓上,清单明明已经受权了读写文件权限,但偏偏就是创建不了目录和文件 调用mkdirs()总是返回false. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/><uses-permission android:name="android.permission.READ_E

UserWarning: mkl-service package failed to import

安装完成anaconda,并设置了两个环境变量  之后再控制台运行python环境,输入import numpy as np,提示错误 D:\InstallFolder\Anaconda3\lib\site-packages\numpy\__init__.py:143: UserWarning: mkl-service package failed to import, therefore