[conda报错 已解决]An unexpected error has occurred. Conda has prepared the above report.
Posted i尧
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[conda报错 已解决]An unexpected error has occurred. Conda has prepared the above report.相关的知识,希望对你有一定的参考价值。
[conda报错 已解决]An unexpected error has occurred. Conda has prepared the above report.
在主机上的服务器里用miniconda安装新环境时,输入
conda create -n name python==x.x.x
时安装失败,遇到了An unexpected error has occurred. Conda has prepared the above report.问题。.
// 显示以下内容
Collecting package metadata (current_repodata.json): failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1079, in __call__
return func(*args, **kwargs)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 84, in _main
exit_code = do_call(args, p)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
return getattr(module, func_name)(args, parser)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/cli/main_create.py", line 41, in execute
install(args, parser, 'create')
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/cli/install.py", line 261, in install
unlink_link_transaction = solver.solve_for_transaction(
File "/home/wangchunxiao/miniconda3/lib/python3.9/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/wangchunxiao/miniconda3/lib/python3.9/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/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/solve.py", line 262, in solve_final_state
ssc = self._collect_all_metadata(ssc)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/solve.py", line 425, in _collect_all_metadata
index, r = self._prepare(prepared_specs)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/solve.py", line 1020, in _prepare
reduced_index = get_reduced_index(self.prefix, self.channels,
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/index.py", line 288, in get_reduced_index
new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 140, in query_all
result = tuple(concat(executor.map(subdir_query, channel_urls)))
File "/home/wangchunxiao/miniconda3/lib/python3.9/concurrent/futures/_base.py", line 608, in result_iterator
yield fs.pop().result()
File "/home/wangchunxiao/miniconda3/lib/python3.9/concurrent/futures/_base.py", line 438, in result
return self.__get_result()
File "/home/wangchunxiao/miniconda3/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result
raise self._exception
File "/home/wangchunxiao/miniconda3/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 132, in <lambda>
subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 145, in query
self.load()
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 210, in load
_internal_state = self._load()
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 407, in _load
_internal_state = self._process_raw_repodata_str(raw_repodata_str)
File "/home/wangchunxiao/miniconda3/lib/python3.9/site-packages/conda/core/subdir_data.py", line 480, in _process_raw_repodata_str
json_obj = json.loads(raw_repodata_str or '')
File "/home/wangchunxiao/miniconda3/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/wangchunxiao/miniconda3/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/wangchunxiao/miniconda3/lib/python3.9/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/wangchunxiao/miniconda3/bin/conda create -n P5 python==3.9.7`
environment variables:
CIO_TEST=<not set>
CONDA_DEFAULT_ENV=base
CONDA_EXE=/home/wangchunxiao/miniconda3/bin/conda
CONDA_PREFIX=/home/wangchunxiao/miniconda3
CONDA_PROMPT_MODIFIER=(base)
CONDA_PYTHON_EXE=/home/wangchunxiao/miniconda3/bin/python
CONDA_ROOT=/home/wangchunxiao/miniconda3
CONDA_SHLVL=1
CURL_CA_BUNDLE=<not set>
PATH=/home/wangchunxiao/miniconda3/bin:/home/wangchunxiao/miniconda3/bin:/h
ome/wangchunxiao/miniconda3/condabin:/usr/local/bin:/usr/bin:/usr/loca
l/sbin:/usr/sbin:/home/wangchunxiao/.local/bin:/home/wangchunxiao/bin
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
active environment : base
active env location : /home/wangchunxiao/miniconda3
shell level : 1
user config file : /home/wangchunxiao/.condarc
populated config files : /home/wangchunxiao/.condarc
conda version : 4.10.3
conda-build version : not installed
python version : 3.9.5.final.0
virtual packages : __cuda=10.2=0
__linux=3.10.0=0
__glibc=2.17=0
__unix=0=0
__archspec=1=x86_64
base environment : /home/wangchunxiao/miniconda3 (writable)
conda av data dir : /home/wangchunxiao/miniconda3/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://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/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://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
package cache : /home/wangchunxiao/miniconda3/pkgs
/home/wangchunxiao/.conda/pkgs
envs directories : /home/wangchunxiao/miniconda3/envs
/home/wangchunxiao/.conda/envs
platform : linux-64
user-agent : conda/4.10.3 requests/2.25.1 CPython/3.9.5 Linux/3.10.0-1160.6.1.el7.x86_64 centos/7.5.1804 glibc/2.17
UID:GID : 1004:1004
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
Upload did not complete.
解决方法一(用此方法解决)参考链接
一、输入以下代码,查看是否存在.condarc文件。
$ conda config --show-sources
出现以下代码,就代表根目录下自动生成了.condarc文件
==> /home/wangchunxiao/.condarc <==
二、如果生成了此文件,将此文件删除
rm -rf ~/.condarc
预备方法
1、关闭VPN!(在用上面的方法时,我已经提前将VPN关掉了,不知道原理但是可以试试。)参考链接
2、尝试输入以下命令行。(尝试过了,没有奏效也没出别的大事)参考链接
conda clean -i
#这句话的目的是删除缓存和索引。
3、尝试输入以下命令行。(没有尝试,看起来很吓人,不敢动!)参考链接
conda clean --packages && conda clean --all && conda update --all
#清除所有包,清除所有东西,更新所有东西
已解决TypeError: search() got an unexpected keyword argument ‘requests_timeout’
已解决(elasticsearch模块报错)TypeError: search() got an unexpected keyword argument ‘requests_timeout’
文章目录
报错代码
粉丝群里面的一个小伙伴想用elasticsearch 模块读取数据,但是发生了报错(当时他心里瞬间凉了一大截,跑来找我求助,然后顺利帮助他解决了,顺便记录一下希望可以帮助到更多遇到这个bug不会解决的小伙伴),报错代码如下::
from elasticsearch import Elasticsearch
es = Elasticsearch(["host": "服务器地址", "port": 端口号])
print(es.ping)
body = 'match':'name':'小鹏'
data = es.search(index='库名',doc_type='表名',body=body,size=10,requests_timeout=60)
print(data)
可以看到导包和传参没有任何问题,但是还是报错了:
报错信息如下:
报错翻译
报错信息翻译:
类型错误:search()获得意外的关键字参数“requests_timeout”
报错原因
报错原因:
这是由于elasticsearch 版本更新导致的,粉丝使用的版本是: 5.5.3,就没有了requests_timeout这个参数了
解决方法
解决方法1:去掉requests_timeout参数查询即可
data = es.search(index='库名',doc_type='表名',body=body,size=10)
解决方法2:安装其他版本的elasticsearch 模块,可以尝试更新版本,或者安装低版本的试试
帮忙解决
本文已收录于:《告别Bug》专栏
本专栏用于记录学习和工作中遇到的各种疑难Bug问题,以及粉丝群里小伙伴提出的各种问题,文章形式:报错代码 + 报错翻译 + 报错原因 + 解决方法,包括程序安装、运行程序过程中等等问题,订阅专栏+关注博主后如遇到其他问题可私聊帮忙解决!!!
以上是关于[conda报错 已解决]An unexpected error has occurred. Conda has prepared the above report.的主要内容,如果未能解决你的问题,请参考以下文章
Python报错:TypeError: __init__() got an unexpected keyword argument 'io_loop' 原因及解决方案
[Bug0061] RabbitMQ 报错 An unexpected connection driver error occured
attempt_load() got an unexpected keyword argument ‘map_location‘
__init__ got an unexpected keyword argument ‘kill_previous‘——新版SublimeText4编译报错
__init__ got an unexpected keyword argument ‘kill_previous‘——新版SublimeText4编译报错