In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how conda uses Tsinghua Source. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Preface
When downloading OpenCV, it is found that the conda channel image of Tsinghua University is no longer available, so record here:
1) how to display all channel
2) how to replace the channel.
1 display all channel
First of all, conda config-- show can display the config information of all conda.
If we only want to see the channels information, type conda config-- show channels, as follows:
(base) C:Usersdehen > conda config-show channels
Channels:
-https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
-defaults
Now we have two sources, a Tsinghua image and a defauls default download source.
However, this Tsinghua source is no longer available. When I downloaded opencv, I typed: conda install opencv, but reported an error:
(base) C:Usersdehen > conda install opencv
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url
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.
ConnectionError (ReadTimeoutError ("HTTPSConnectionPool (host='mirrors.tuna.tsinghua.edu.cn', port=443): Read timed out."))
So I'm going to delete this source.
2 remove Tsinghua image
Input: conda config-- remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
The purpose of this command is to remove the Tsinghua source previously displayed by conda config-show channels.
(base) C:Usersdehen > conda config-- remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
(base) C:Usersdehen > conda config-show channels
Channels:
-defaults
(base) C:Usersdehen >
At this time, run conda config-show channels and you will find that Tsinghua Source has been deleted.
3 add available Tsinghua sources
Referring to [4], I found that my previously installed address https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ of Tsinghua Source is a mirror of conda-forge, one of the tripartite sources of conda maintained by Tsinghua University. In addition, Tsinghua has many available sources.
So I added it according to the instructions on the official website:
Conda config-add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config-add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config-set show_channel_urls yes
Conda config-- set show_channel_urls yes means that the url of channel is displayed when installing the package from channel, so that you can know the source of the package installation.
4 download opencv
After adding this source (channel), I rerun conda install opencv and was able to download it successfully!
But the middle is actually automatic installation, in the pre-installation confirmation [Y _ conda N], skipped directly, the default is Y.
It made me very uncomfortable, so I ran:
Conda config-set always_yes false
(this means that in the installation confirmation, it is not the default yes, but it is up to me to decide.)
5 some other conda instructions
Conda install installs the specified package
Conda remove removes the specified package
Conda update updates the specified package
Thank you for reading! This is the end of the article on "how conda uses Tsinghua Source". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.