pip安装模块报错ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org‘, port=443): Read timed

这篇具有很好参考价值的文章主要介绍了pip安装模块报错ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org‘, port=443): Read timed。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

今天在安装python模块时提示ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org’, port=443): Read timed out
具体报错如下:

[root@0018 /]# pip install pygame
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pygame
  Downloading pygame-2.0.3-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl (13.3 MB)
     |███████████▊                    | 4.9 MB 8.0 kB/s eta 0:17:40ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 223, in _main
    status = self.run(options, args)
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
    return func(self, options, args)
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 321, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/usr/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 180, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/usr/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 385, in _resolve_one
    dist = self._get_dist_for(req_to_install)
  File "/usr/lib/python2.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 337, in _get_dist_for
    dist = self.preparer.prepare_linked_requirement(req)
  File "/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 480, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
  File "/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 505, in _prepare_linked_requirement
    self.download_dir, hashes,
  File "/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 257, in unpack_url
    hashes=hashes,
  File "/usr/lib/python2.7/site-packages/pip/_internal/operations/prepare.py", line 130, in get_http_url
    from_path, content_type = download(link, temp_dir.path)
  File "/usr/lib/python2.7/site-packages/pip/_internal/network/download.py", line 163, in __call__
    for chunk in chunks:
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/progress_bars.py", line 168, in iter
    for x in it:
  File "/usr/lib/python2.7/site-packages/pip/_internal/network/utils.py", line 88, in response_chunks
    decode_content=False,
  File "/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/response.py", line 576, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/response.py", line 541, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "/usr/lib64/python2.7/contextlib.py", line 35, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python2.7/site-packages/pip/_vendor/urllib3/response.py", line 451, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

处理方法pip --default-timeout=100 install -U pygame

这使用pip安装超时,绝大多数原因是pip源在外国,所以国内使用,网络就算稳定,也有一定超时。–default-timeout即增大延时时间。或者更换PIP源,目前常用的有以下几种:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
临时解决:pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple

结果文章来源地址https://www.toymoban.com/news/detail-516062.html

[root@0018 /]# pip --default-timeout=100 install -U pygame
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pygame
  Downloading pygame-2.0.3-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl (13.3 MB)
     |████████████████████████████████| 13.3 MB 22 kB/s 
Installing collected packages: pygame
Successfully installed pygame-2.0.3

到了这里,关于pip安装模块报错ReadTimeoutError: HTTPSConnectionPool(host=‘files.pythonhosted.org‘, port=443): Read timed的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • OpenAI报错 time out:HTTPSConnectionPool(host=‘api.openai.com‘, port=443)

    使用openai的api调用chatGPT报错,同样的代码在另一台机器没有问题 使用官方示例 报错信息: 猜测是代理问题,但是有时候不开代理好像也有可能出现 urllib3降低版本到1.25.11 可以看我另一篇博文的介绍:传送门 这个方法对部分人有用,但很不幸我是另一部分。。。其实也挺莫

    2024年02月16日
    浏览(59)
  • OpenAI调用API报错 time out:HTTPSConnectionPool(host=‘api.openai.com‘, port=443)

    代码如下(源自网络): 执行报错: 参考大佬文章:传送门 简单来说就是 1.26.0 版本的urllib3添加了HTTPS支持,但代理服务器不支持HTTPS,所以报错(pip走代理报错也差不多类似原因,具体请参考上文,有详细解读) 这个方法对部分人有用,但很不幸我是另一部分(哭)! 查

    2024年02月06日
    浏览(45)
  • 下载torchvision报错:Could not install packages due to an OSError: HTTPSConnectionPool(host=‘files.python

    报错如下:Could not install packages due to an OSError: HTTPSConnectionPool(host=\\\'files.pythonhosted.org\\\', port=443): Max retries exceeded with url: /packages/c0/8f/dfa473f3a6241bff91ae8bb90 5bd0afceb827f37de2917a94b5c4b1112bf/Pillow-9.3.0-cp39-cp39-win_amd64.whl (Caused by ConnectTimeoutError(pip._vendor.urllib3.connection.HTTPSConnection object at 0x000

    2024年02月15日
    浏览(34)
  • 出现了HTTPSConnectionPool(host=‘huggingface.co‘, port=443)错误的解决方法

    在下载huggingface 模型的时候,经常会出现这个错误,HTTPSConnectionPool(host=‘huggingface.co’, port=443),即使你已经有了正确的上网姿势。 如在下载Tokenizer的时候, 就会出现以上的错误HTTPSConnectionPool(host=‘huggingface.co‘, port=443)。 解决的办法可以有两种。 1.直接下载模型 第一种方

    2024年02月08日
    浏览(29)
  • Python代理IP异常:requests.exceptions.ProxyError: HTTPSConnectionPool(host=‘xxxx‘, port=443)

            这是我在使用Python爬取网页信息的时候出现的异常。         由于很多要爬取的网站会把“IP限制”作为反爬虫手段,所以我偶尔会使用“代理IP服务器”去处理相关需求,因为我觉得每次都 time.sleep(10) 太漫长,对频繁且大量的请求十分不友好。         推荐代理

    2024年02月03日
    浏览(27)
  • 解决requests.exceptions.ProxyError: HTTPSConnectionPool(host=‘api.github.com‘, port=443): Max retries

    一般来说,出现这种错误的原因可能是以下之一: 代理设置错误 : 你的计算机或网络环境可能配置了代理服务器,但代理服务器设置可能不正确。你需要检查你的代理设置是否正确,并确保它们与你的网络环境相匹配。 代理服务器不可用 : 如果代理服务器无法访问或不可用

    2024年02月05日
    浏览(42)
  • requests.exceptions.SSLError: HTTPSConnectionPool(host=‘.*.‘, port=443): 开启代理时无法使用python的requests库

    python的requests,开启v2rayN后,无法使用python的requests库报错: Traceback (most recent call last):   File \\\"E:DpandataMyprojectSjj1024venvlibsite-packagesurllib3connection.py\\\", line 174, in _new_conn     conn = connection.create_connection(   File \\\"E:DpandataMyprojectSjj1024venvlibsite-packagesurllib3utilconnection.py\\\", li

    2024年02月11日
    浏览(28)
  • 成功解决HTTPSConnectionPool(host=‘huggingface.co‘, port=443): Max retries exceeded with url:LocalEntryNo

    HTTPSConnectionPool(host=\\\'huggingface.co\\\', port=443): Max retries exceeded with url:LocalEntryNotFoundError: Connection error, and we cannot find the requested files in the disk cache. Please try again or make sure your Internet connection is on. 目录 解决问题 解决思路 解决方法 这个错误表明您的代码尝试从\\\"huggingface.co\\\"下载模型文

    2024年02月08日
    浏览(75)
  • 解决:requests.exceptions.SSLError: HTTPSConnectionPool(host=‘x‘,port=x): Max retries exceeded with url

    在使用selenium操作Chrome浏览器报错:requests.exceptions.SSLError: HTTPSConnectionPool(host=‘lv-pc-api-sinfonlineb.ulikecam.com’, port=443): Max retries exceeded with url: /get (Caused by SSLError(SSLError(1, ‘[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1123)’))) 报错信息如下: 报错截图如下: 主要报错信息内容

    2024年02月21日
    浏览(30)
  • 使用pip安装Pygame模块的教程

    Pygame是一个用于开发2D游戏的Python模块,它提供了丰富的功能和工具,使得游戏开发变得简单而有趣。在本教程中,我将向你介绍如何使用pip来安装Pygame模块,并提供相应的源代码示例。 步骤1:安装Python和pip 在开始之前,确保你已经安装了Python和pip。你可以从Python官方网站

    2024年02月21日
    浏览(40)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包