conda create -n name python=3.7无法创建问题合集
时间:2024-03-26 14:36:02 来源:网络cs 作者:付梓 栏目:跨境学堂 阅读:
错误1:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/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/pkgs/free/linux-64'
解决方法一,直接解决:
1、修改镜像源
参照:https://blog.csdn.net/Michael_Cretu_/article/details/122727872
# 显示镜像源conda config --show-sources# 添加镜像源(example)conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/# 删除镜像源(example)conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
参照:https://www.cnblogs.com/tianlang25/p/12433025.html
再次修改:
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/
此次报错为:
https://www.cnblogs.com/tianlang25/p/12433025.html 再次删除镜像源:conda config --remove-key channels,重新开始,错误又变回原来的错误
2、看错误描述像是是清华镜像的问题,于是查看conda信息
参照:新建虚拟环境时出错CondaHTTPError: HTTP 000 CONNECTION FAILED for url 问题:创建虚拟环境时,出现以下错误 解决1.看错误描述像是是清华镜像的问题,于是查看conda信息 2.于是我删除了所有的清华镜像。 3.再次查看conda信息(已删除) 4.在此新建虚拟环境,成功 参考: 删除镜像源+pyt…https://zhuanlan.zhihu.com/p/432658829
(1)查看conda信息
conda info
(2)删除所有清华镜像:
conda config --remove-key channels
(3)再次查看conda信息
conda info
(4)创建新虚拟环境
仍不成功,报错信息为:
3、删除.condrac文件
参考:Python&aconda系列:conda创建虚拟环境、切换环境 报错-CSDN博客
但是在XFTP中,找不到.condrac文件
解决办法:
1、设置 ------> 勾选”显示隐藏的文件“
2、删除.condrac文件
结果:conda create -n name python=3.7仍然报错
3、重新创建.condrac文件
参照:anaconda换清华源后报错解决(1) - 知乎
删除.condrac中的default;
将https改为http也不行;
参照:Conda换源踩坑2021-04-18 - 简书
出现错误:
Traceback (most recent call last): File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/exceptions.py", line 1082, in __call__ return func(*args, **kwargs) File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/cli/main.py", line 87, in _main exit_code = do_call(args, p) File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 84, in do_call return getattr(module, func_name)(args, parser) File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/cli/main_create.py", line 41, in execute install(args, parser, 'create') File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/cli/install.py", line 260, in install unlink_link_transaction = solver.solve_for_transaction( File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/core/solve.py", line 152, in solve_for_transaction unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier, File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/core/solve.py", line 195, in solve_for_diff final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned, File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/core/solve.py", line 300, in solve_final_state ssc = self._collect_all_metadata(ssc) File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/common/io.py", line 88, in decorated return f(*args, **kwds) File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/core/solve.py", line 463, in _collect_all_metadata index, r = self._prepare(prepared_specs) File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/core/solve.py", line 1058, in _prepare reduced_index = get_reduced_index(self.prefix, self.channels, File "/usr/local/anaconda3-2021.11/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 "/usr/local/anaconda3-2021.11/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 "/usr/local/anaconda3-2021.11/lib/python3.9/concurrent/futures/_base.py", line 608, in result_iterator yield fs.pop().result() File "/usr/local/anaconda3-2021.11/lib/python3.9/concurrent/futures/_base.py", line 445, in result return self.__get_result() File "/usr/local/anaconda3-2021.11/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result raise self._exception File "/usr/local/anaconda3-2021.11/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/anaconda3-2021.11/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 "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/core/subdir_data.py", line 145, in query self.load() File "/usr/local/anaconda3-2021.11/lib/python3.9/site-packages/conda/core/subdir_data.py", line 210, in load _internal_state = self._load() File "/usr/local/anaconda3-2021.11/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 "/usr/local/anaconda3-2021.11/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 "/usr/local/anaconda3-2021.11/lib/python3.9/json/__init__.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/anaconda3-2021.11/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/anaconda3-2021.11/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 107 (char 106)`$ /usr/local/anaconda3-2021.11/bin/conda create -n py37SSEGCN python=3.7` environment variables: CIO_TEST=<not set> CONDA_ROOT=/usr/local/anaconda3-2021.11 CURL_CA_BUNDLE=<not set> PATH=/home/drh/.vscode- server/bin/0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2/bin/remote-cli:/ho me/drh/.local/bin:/usr/local/anaconda3-2021.11/bin:/usr/local/sbin:/us r/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: /snap/bin REQUESTS_CA_BUNDLE=<not set> SSL_CERT_FILE=<not set> active environment : None user config file : /home/drh/.condarc populated config files : /home/drh/.condarc conda version : 4.12.0 conda-build version : 3.21.5 python version : 3.9.7.final.0 virtual packages : __cuda=11.6=0 __linux=5.4.0=0 __glibc=2.31=0 __unix=0=0 __archspec=1=x86_64 base environment : /usr/local/anaconda3-2021.11 (read only) conda av data dir : /usr/local/anaconda3-2021.11/etc/conda conda av metadata url : None channel URLs : http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64 http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/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 : /usr/local/anaconda3-2021.11/pkgs /home/drh/.conda/pkgs envs directories : /home/drh/.conda/envs /usr/local/anaconda3-2021.11/envs platform : linux-64 user-agent : conda/4.12.0 requests/2.26.0 CPython/3.9.7 Linux/5.4.0-125-generic ubuntu/20.04.4 glibc/2.31 UID:GID : 1008:1008 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]: Timeout reached. No report sent.
参照:https://blog.csdn.net/qq_41929204/article/details/126128393
又回到最开始的错误:
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/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.If your current network has https://www.anaconda.com blocked, please filea support request with your network engineering team.'https://repo.anaconda.com/pkgs/main/linux-64'
删除conda clean -i仍然报错
参照:anaconda创建虚拟环境报错:An HTTP error occurred when trying to retrieve this URL.-CSDN博客
Collecting package metadata (current_repodata.json): failedCondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/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/pkgs/free/linux-64'
解决方法二,换种方法解决:
1、conda 在断网情况下创建虚拟环境
参考地址:conda 在断网情况下创建虚拟环境_repodata.json.bz2-CSDN博客
conda create -n py37SSEGCN --clone base
下载base中的包失败
2、clone其他虚拟环境
参考:Conda创建环境失败:CondaHTTPError: HTTP 000 CONNECTION FAILED-CSDN博客
(1)添加镜像源
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/conda config --set show_channel_urls yes
(2)clone其他镜像源
conda create -n py37SSEGCN --clone py37dgcn
成功!!!
阅读本书更多章节>>>>本文链接:https://www.kjpai.cn/xuetang/2024-03-26/148958.html,文章来源:网络cs,作者:付梓,版权归作者所有,如需转载请注明来源和作者,否则将追究法律责任!