In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "Python permanent configuration of domestic mirror source installation method tutorial", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and study the "Python permanent configuration domestic mirror source installation method tutorial"!
Catalogue
Source of problem
Configure domestic mirror sources
Source of problem
This error persists today when installing the xlutils package using pip install xlutils
ReadTimeoutError: HTTPSConnectionPool (host='files.pythonhosted.org', port=443): Read timed out.
This may be due to the fact that when some libraries are installed in this way, they will be downloaded from foreign mirror sources, resulting in a response timeout.
Too heart-wrenching, sometimes want to use a library, but have been unable to download it, there is no way to worry! How to solve the problem?
Configure domestic mirror sources
Here, before formally talking about the knowledge points, I would like to introduce to you a few commonly used mirror sources. It doesn't matter if you don't know, just understand.
Temporary use of "domestic Mirror Source" by ①
If you don't want to configure the mirror source, you just want to temporarily use the domestic mirror source and install a library. At this point, you can enter the following command:
# download directly, slow pip install pandas # download using domestic mirror sources, fast pip install pandas-I https://pypi.tuna.tsinghua.edu.cn/simple/
Notice the difference between the two, except that the-I parameter is used to specify the mirror address.
This method is one-time, and you need to do this all the time if you want to download other libraries.
② permanently uses "domestic Mirror Source"
Is there a way to solve this problem once and for all? This is what we are going to talk about. We will tell you about it on the platform of linux and windows respectively.
For the linux platform:
First, create a directory pip and a pip.conf file under the directory using the following command.
# create a directory mkdir ~ / .pip # change to this directory cd ~ / .pip # in this directory, create a file touch pip.conf
Next, open the pip.conf file using the following command.
Sudo vi / .pip/pip.conf
Then, write the following into it.
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple[install]trusted-host = https://pypi.tuna.tsinghua.edu.cn # trusted-host this parameter is to avoid trouble, otherwise it may prompt you not to be trusted
Then, save and exit. If you are not familiar with the linux command, go down and learn by yourself.
For the windows platform:
First, you need to create a new folder pip under the user user directory
Next, under the pip folder, create a pip.txt text file, and then change the suffix from "txt" to "ini"
Finally, write the following into it
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple[install]trusted-host = pypi.tuna.tsinghua.edu.cn
After the modification is completed, save it.
Start cmd again, use the "pip install library name" to install the related libraries, and you can download from domestic sources by default.
Thank you for your reading, the above is the "Python permanent configuration of domestic mirror source installation method tutorial" content, after the study of this article, I believe you on the Python permanent configuration of domestic mirror source installation method tutorial this problem has a deeper understanding, the specific use of the need for you to practice and verify. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.