posted on 2023-05-21 18:35 read(1079) comment(0) like(3) collect(1)
Table of contents
The main reason: the configuration is not paired
Method B: Modify .condarc (runtime configuration file)
Reason A: Proxy or VPN is enabled
Reason B: The security housekeeper such as the firewall is not turned off
Reason C: The mirror address cannot be accessed
Reason D: mirror source plus system
Reason E: The server connected to the internal network cannot access the external network
Conda config related command format
tips: pip mirror source download package
Temporarily set the mirror source
Permanently set mirror source download
Because the download speed of the default source is slow, replace the mirror source.
Take Tsinghua Source as an example Index of /anaconda/pkgs/main/ | Tsinghua Open Source Software Mirror Station | Tsinghua Open Source Mirror
- (删除 ”- default“(可选))
- conda config --remove channels defaults
- (添加镜像源,注意是http,而非https,因为https有时候会出现连接错误的问题,改成http后不会再出现此类问题。)
- conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- (在设置中显示以上镜像源)
- conda config --set show_channel_urls yes
- (关掉验证,对于http来说,走的是明文传输,不加密的,就不需要验证,其中信息的加密方式为SSL)
- conda config --set ssl_verify false
If unsuccessful, try method B
You can also change ssl_verify directly in the .condarc file;
If the .condarc file cannot be found, it is because the conda config command was not entered in the cmd command. Only after entering the command for the first time, the system will automatically create the .condarc file.
- show_channel_urls: true
- default_channels:
- - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64
- - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
- custom_channels:
- conda-forge: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- msys2: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- bioconda: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- menpo: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- pytorch: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- simpleitk: http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
- ssl_verify: false
a. The website directly opens the mirror address and finds that it cannot enter, which means that the reason is C
b. Execute the " conda config --remove-key channels " command to restore the source to the default.
Perform the download again. If it is found that the other descriptions are the same except for the mirror address, it means that it is not the reason C
Domestic mirror sources
Alibaba Cloud http://mirrors.aliyun.com/pypi/simple/
Douban http://pypi.douban.com/simple/
Tsinghua University https://pypi.tuna.tsinghua.edu.cn/simple/
University of Science and Technology of China http://pypi.mirrors.ustc.edu.cn/simple/
Huazhong University of Science and Technology http://pypi.hustunique.com/
For example: replace Tsinghua source with Zhongke Dayuan
https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
Download via conda install cython command
(External network here: according to the definition of the server)
You can download the installation package, upload it to the server, and use it as a local source
conda config --show
conda config --append channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --remove channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --remove channels defaults
pip install Package to be installed https://pypi.tuna.tsinghua.edu.cn/simple opencv-contrib-python
pip install opencv-python https://pypi.tuna.tsinghua.edu.cn/simple opencv-contrib-python
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Reference link: Solve CondaHTTPError: HTTP 000 CONNECTION FAILED for url<https://mirrors.tuna.tsinghua.edu.cn/anaconda***_Zhou's Learning Notes Blog-CSDN Blog
Author:Poison
link:http://www.pythonblackhole.com/blog/article/25354/ec94b0d4d5cfccbdf40a/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!