python中Read timed out.报错

it2026-08-29  5

报错如下:

pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

在python使用中,会经常遇到ReadTimeout错误,造成这个问题的原因就是网速问题,因为大部分的源都是在国外的,所以,采用清华源或者中科院源往往更能有效的解决问题,如下:

 

以下两个方法是之前在博客搜索解决问题时碰到的,但实际上在尝试之后没有解决问题,特意po出运行截图以供参考。

方法一:可以考虑换个快一点的网速,因为我用的是校园网所以也很有可能是网太慢而导致的。如下图只下载了13k就停了

方法二:(借鉴别的博客的)

pip --default-timeout=1000 install -U 模块名 例如 pip --default-timeout=1000 install -U pytesseract 来下载pytesseract,让它的延迟检测时间变长。

 

参考博客:https://blog.csdn.net/hahaxq/article/details/104120025

https://blog.csdn.net/qq_41897154/article/details/109229272

最新回复(0)