分析pip 下载原理(一):超时或者下载失败raise ReadTimeoutError(self._pool, None, 'Read timed out.') pip._vendor.urllib

本文主要是介绍分析pip 下载原理(一):超时或者下载失败raise ReadTimeoutError(self._pool, None, 'Read timed out.') pip._vendor.urllib,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

时间紧张,未完待续....

网络环境差的时候需要我们独立的进行相对应的包下载离线安装,或者给pip 加上 国内的镜像源比如加上清华的镜像源:

参考网址:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

Microsoft Windows [版本 10.0.17134.1]
(c) 2018 Microsoft Corporation。保留所有权利。D:\download>pip install virtualenvwrapper-4.8.4.tar.gz
Processing d:\download\virtualenvwrapper-4.8.4.tar.gz
Collecting virtualenv (from virtualenvwrapper==4.8.4)WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/virtualenv/Downloading https://files.pythonhosted.org/packages/84/3a/9d656ec2535fa5f6680d55ef93a05f890bd1b2ad6f2bf97b34a679abf365/virtualenv-20.0.13-py2.py3-none-any.whl (4.6MB)|███████████                     | 1.6MB 8.4kB/s eta 0:05:56ERROR: Exception:
Traceback (most recent call last):File "d:\language\python\python36\lib\site-packages\pip\_vendor\urllib3\response.py", line 397, in _error_catcheryieldFile "d:\language\python\python36\lib\site-packages\pip\_vendor\urllib3\response.py", line 479, in readdata = self._fp.read(amt)File "d:\language\python\python36\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in readdata = self.__fp.read(amt)File "d:\language\python\python36\lib\http\client.py", line 449, in readn = self.readinto(b)File "d:\language\python\python36\lib\http\client.py", line 493, in readinton = self.fp.readinto(b)File "d:\language\python\python36\lib\socket.py", line 586, in readintoreturn self._sock.recv_into(b)File "d:\language\python\python36\lib\ssl.py", line 1012, in recv_intoreturn self.read(nbytes, buffer)File "d:\language\python\python36\lib\ssl.py", line 874, in readreturn self._sslobj.read(len, buffer)File "d:\language\python\python36\lib\ssl.py", line 631, in readv = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed outDuring handling of the above exception, another exception occurred:Traceback (most recent call last):File "d:\language\python\python36\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in mainstatus = self.run(options, args)File "d:\language\python\python36\lib\site-packages\pip\_internal\commands\install.py", line 345, in runresolver.resolve(requirement_set)File "d:\language\python\python36\lib\site-packages\pip\_internal\legacy_resolve.py", line 196, in resolveself._resolve_one(requirement_set, req)File "d:\language\python\python36\lib\site-packages\pip\_internal\legacy_resolve.py", line 359, in _resolve_oneabstract_dist = self._get_abstract_dist_for(req_to_install)File "d:\language\python\python36\lib\site-packages\pip\_internal\legacy_resolve.py", line 307, in _get_abstract_dist_forself.require_hashesFile "d:\language\python\python36\lib\site-packages\pip\_internal\operations\prepare.py", line 199, in prepare_linked_requirementprogress_bar=self.progress_barFile "d:\language\python\python36\lib\site-packages\pip\_internal\download.py", line 1064, in unpack_urlprogress_bar=progress_barFile "d:\language\python\python36\lib\site-packages\pip\_internal\download.py", line 924, in unpack_http_urlprogress_bar)File "d:\language\python\python36\lib\site-packages\pip\_internal\download.py", line 1152, in _download_http_url_download_url(resp, link, content_file, hashes, progress_bar)File "d:\language\python\python36\lib\site-packages\pip\_internal\download.py", line 861, in _download_urlhashes.check_against_chunks(downloaded_chunks)File "d:\language\python\python36\lib\site-packages\pip\_internal\utils\hashes.py", line 75, in check_against_chunksfor chunk in chunks:File "d:\language\python\python36\lib\site-packages\pip\_internal\download.py", line 829, in written_chunksfor chunk in chunks:File "d:\language\python\python36\lib\site-packages\pip\_internal\utils\ui.py", line 156, in iterfor x in it:File "d:\language\python\python36\lib\site-packages\pip\_internal\download.py", line 818, in resp_readdecode_content=False):File "d:\language\python\python36\lib\site-packages\pip\_vendor\urllib3\response.py", line 531, in streamdata = self.read(amt=amt, decode_content=decode_content)File "d:\language\python\python36\lib\site-packages\pip\_vendor\urllib3\response.py", line 496, in readraise IncompleteRead(self._fp_bytes_read, self.length_remaining)File "d:\language\python\python36\lib\contextlib.py", line 99, in __exit__self.gen.throw(type, value, traceback)File "d:\language\python\python36\lib\site-packages\pip\_vendor\urllib3\response.py", line 402, in _error_catcherraise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.D:\download>pip install virtualenvwrapper-4.8.4.tar.gz
Processing d:\download\virtualenvwrapper-4.8.4.tar.gz
ERROR: Operation cancelled by user
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.D:\download>pip install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualenvwrapper-4.8.4.tar.gz
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing d:\download\virtualenvwrapper-4.8.4.tar.gz
Collecting virtualenv (from virtualenvwrapper==4.8.4)Downloading https://pypi.tuna.tsinghua.edu.cn/packages/84/3a/9d656ec2535fa5f6680d55ef93a05f890bd1b2ad6f2bf97b34a679abf365/virtualenv-20.0.13-py2.py3-none-any.whl (4.6MB)|████████████████████████████████| 4.6MB 273kB/s
Collecting virtualenv-clone (from virtualenvwrapper==4.8.4)Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ba/f8/50c2b7dbc99e05fce5e5b9d9a31f37c988c99acd4e8dedd720b7b8d4011d/virtualenv_clone-0.5.3-py2.py3-none-any.whl
Collecting stevedore (from virtualenvwrapper==4.8.4)Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e6/49/a35dd566626892d577e426dbe5ea424dd7fbe10645f2c1070dcba474eca9/stevedore-1.32.0-py2.py3-none-any.whl (43kB)|████████████████████████████████| 51kB 656kB/s
Requirement already satisfied: importlib-metadata<2,>=0.12; python_version < "3.8" in d:\language\python\python36\lib\site-packages (from virtualenv->virtualenvwrapper==4.8.4) (1.5.0)
Collecting importlib-resources<2,>=1.0; python_version < "3.7" (from virtualenv->virtualenvwrapper==4.8.4)Downloading https://pypi.tuna.tsinghua.edu.cn/packages/8f/36/e678bc02cad98e566fbd7e6711ab2f389fc9adfb1edbb9f553eae41f9f97/importlib_resources-1.4.0-py2.py3-none-any.whl
Requirement already satisfied: appdirs<2,>=1.4.3 in d:\language\python\python36\lib\site-packages\appdirs-1.4.3-py3.6.egg (from virtualenv->virtualenvwrapper==4.8.4) (1.4.3)
Requirement already satisfied: six<2,>=1.9.0 in d:\language\python\python36\lib\site-packages (from virtualenv->virtualenvwrapper==4.8.4) (1.10.0)
Collecting filelock<4,>=3.0.0 (from virtualenv->virtualenvwrapper==4.8.4)Downloading https://pypi.tuna.tsinghua.edu.cn/packages/93/83/71a2ee6158bb9f39a90c0dea1637f81d5eef866e188e1971a1b1ab01a35a/filelock-3.0.12-py3-none-any.whl
Collecting distlib<1,>=0.3.0 (from virtualenv->virtualenvwrapper==4.8.4)Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7d/29/694a3a4d7c0e1aef76092e9167fbe372e0f7da055f5dcf4e1313ec21d96a/distlib-0.3.0.zip (571kB)|████████████████████████████████| 573kB 328kB/s
Collecting pbr!=2.1.0,>=2.0.0 (from stevedore->virtualenvwrapper==4.8.4)Downloading https://pypi.tuna.tsinghua.edu.cn/packages/7a/db/a968fd7beb9fe06901c1841cb25c9ccb666ca1b9a19b114d1bbedf1126fc/pbr-5.4.4-py2.py3-none-any.whl (110kB)|████████████████████████████████| 112kB 409kB/s
Requirement already satisfied: zipp>=0.5 in d:\language\python\python36\lib\site-packages (from importlib-metadata<2,>=0.12; python_version < "3.8"->virtualenv->virtualenvwrapper==4.8.4) (2.2.0)
Installing collected packages: importlib-resources, filelock, distlib, virtualenv, virtualenv-clone, pbr, stevedore, virtualenvwrapperRunning setup.py install for distlib ... doneRunning setup.py install for virtualenvwrapper ... done
Successfully installed distlib-0.3.0 filelock-3.0.12 importlib-resources-1.4.0 pbr-5.4.4 stevedore-1.32.0 virtualenv-20.0.13 virtualenv-clone-0.5.3 virtualenvwrapper-4.8.4
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.D:\download>

pip 是个非常普通的python 下载工具,但是尽管简单常用,我们还是需要明白他的机制,以及增加运用的手段的灵活性 

这篇关于分析pip 下载原理(一):超时或者下载失败raise ReadTimeoutError(self._pool, None, 'Read timed out.') pip._vendor.urllib的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/485086

相关文章

性能分析之MySQL索引实战案例

文章目录 一、前言二、准备三、MySQL索引优化四、MySQL 索引知识回顾五、总结 一、前言 在上一讲性能工具之 JProfiler 简单登录案例分析实战中已经发现SQL没有建立索引问题,本文将一起从代码层去分析为什么没有建立索引? 开源ERP项目地址:https://gitee.com/jishenghua/JSH_ERP 二、准备 打开IDEA找到登录请求资源路径位置

深入探索协同过滤:从原理到推荐模块案例

文章目录 前言一、协同过滤1. 基于用户的协同过滤(UserCF)2. 基于物品的协同过滤(ItemCF)3. 相似度计算方法 二、相似度计算方法1. 欧氏距离2. 皮尔逊相关系数3. 杰卡德相似系数4. 余弦相似度 三、推荐模块案例1.基于文章的协同过滤推荐功能2.基于用户的协同过滤推荐功能 前言     在信息过载的时代,推荐系统成为连接用户与内容的桥梁。本文聚焦于

常用的jdk下载地址

jdk下载地址 安装方式可以看之前的博客: mac安装jdk oracle 版本:https://www.oracle.com/java/technologies/downloads/ Eclipse Temurin版本:https://adoptium.net/zh-CN/temurin/releases/ 阿里版本: github:https://github.com/

hdu4407(容斥原理)

题意:给一串数字1,2,......n,两个操作:1、修改第k个数字,2、查询区间[l,r]中与n互质的数之和。 解题思路:咱一看,像线段树,但是如果用线段树做,那么每个区间一定要记录所有的素因子,这样会超内存。然后我就做不来了。后来看了题解,原来是用容斥原理来做的。还记得这道题目吗?求区间[1,r]中与p互质的数的个数,如果不会的话就先去做那题吧。现在这题是求区间[l,r]中与n互质的数的和

SWAP作物生长模型安装教程、数据制备、敏感性分析、气候变化影响、R模型敏感性分析与贝叶斯优化、Fortran源代码分析、气候数据降尺度与变化影响分析

查看原文>>>全流程SWAP农业模型数据制备、敏感性分析及气候变化影响实践技术应用 SWAP模型是由荷兰瓦赫宁根大学开发的先进农作物模型,它综合考虑了土壤-水分-大气以及植被间的相互作用;是一种描述作物生长过程的一种机理性作物生长模型。它不但运用Richard方程,使其能够精确的模拟土壤中水分的运动,而且耦合了WOFOST作物模型使作物的生长描述更为科学。 本文让更多的科研人员和农业工作者

MOLE 2.5 分析分子通道和孔隙

软件介绍 生物大分子通道和孔隙在生物学中发挥着重要作用,例如在分子识别和酶底物特异性方面。 我们介绍了一种名为 MOLE 2.5 的高级软件工具,该工具旨在分析分子通道和孔隙。 与其他可用软件工具的基准测试表明,MOLE 2.5 相比更快、更强大、功能更丰富。作为一项新功能,MOLE 2.5 可以估算已识别通道的物理化学性质。 软件下载 https://pan.quark.cn/s/57

pip-tools:打造可重复、可控的 Python 开发环境,解决依赖关系,让代码更稳定

在 Python 开发中,管理依赖关系是一项繁琐且容易出错的任务。手动更新依赖版本、处理冲突、确保一致性等等,都可能让开发者感到头疼。而 pip-tools 为开发者提供了一套稳定可靠的解决方案。 什么是 pip-tools? pip-tools 是一组命令行工具,旨在简化 Python 依赖关系的管理,确保项目环境的稳定性和可重复性。它主要包含两个核心工具:pip-compile 和 pip

衡石分析平台使用手册-单机安装及启动

单机安装及启动​ 本文讲述如何在单机环境下进行 HENGSHI SENSE 安装的操作过程。 在安装前请确认网络环境,如果是隔离环境,无法连接互联网时,请先按照 离线环境安装依赖的指导进行依赖包的安装,然后按照本文的指导继续操作。如果网络环境可以连接互联网,请直接按照本文的指导进行安装。 准备工作​ 请参考安装环境文档准备安装环境。 配置用户与安装目录。 在操作前请检查您是否有 sud

hdu4407容斥原理

题意: 有一个元素为 1~n 的数列{An},有2种操作(1000次): 1、求某段区间 [a,b] 中与 p 互质的数的和。 2、将数列中某个位置元素的值改变。 import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.IOException;import java.io.Inpu

hdu4059容斥原理

求1-n中与n互质的数的4次方之和 import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.PrintWrit