Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Solve the problem of pip installation module timeout under windows

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Recently, when I was learning the flask framework, the following error occurred when installing flask-sqlalchemy:

The error message is that the https connection timed out. Due to well-known reasons, domestic access to pypi.python.org is very slow.

Solution: 1, create a pip configuration file in the home directory

Create and edit the pip.ini file by adding the following three lines:

[global] timeout = 6000index-url = http://pypi.douban.com/simpletrusted-host = pypi.douban.com

The mirror address of Douban is used here. Just modify and save it.

Install flask-sqlalchemy again

You can see the speed of the Internet, .

The PS:Linux system needs to create a .pip folder and a pip.conf file in the home directory, such as ~ / .pip / pip.conf, the contents of which are the same as above.

2. Use the-I parameter (pip install-- help)-I,-- index-url Base URL of Python Package Index (default https://pypi.python.org/simple).) when installing the module with pip This should point to a repository compliant with PEP 503 (the simple repository API) or a local directory laid out in the same format.

The usage is as follows:

Pip install-I https://pypi.doubanio.com/simple/ flask-sqlalchemy

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report