分析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

相关文章

Java实现文件图片的预览和下载功能

《Java实现文件图片的预览和下载功能》这篇文章主要为大家详细介绍了如何使用Java实现文件图片的预览和下载功能,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... Java实现文件(图片)的预览和下载 @ApiOperation("访问文件") @GetMapping("

Python中随机休眠技术原理与应用详解

《Python中随机休眠技术原理与应用详解》在编程中,让程序暂停执行特定时间是常见需求,当需要引入不确定性时,随机休眠就成为关键技巧,下面我们就来看看Python中随机休眠技术的具体实现与应用吧... 目录引言一、实现原理与基础方法1.1 核心函数解析1.2 基础实现模板1.3 整数版实现二、典型应用场景2

Java的IO模型、Netty原理解析

《Java的IO模型、Netty原理解析》Java的I/O是以流的方式进行数据输入输出的,Java的类库涉及很多领域的IO内容:标准的输入输出,文件的操作、网络上的数据传输流、字符串流、对象流等,这篇... 目录1.什么是IO2.同步与异步、阻塞与非阻塞3.三种IO模型BIO(blocking I/O)NI

Spring事务中@Transactional注解不生效的原因分析与解决

《Spring事务中@Transactional注解不生效的原因分析与解决》在Spring框架中,@Transactional注解是管理数据库事务的核心方式,本文将深入分析事务自调用的底层原理,解释为... 目录1. 引言2. 事务自调用问题重现2.1 示例代码2.2 问题现象3. 为什么事务自调用会失效3

Docker镜像pull失败两种解决办法小结

《Docker镜像pull失败两种解决办法小结》有时候我们在拉取Docker镜像的过程中会遇到一些问题,:本文主要介绍Docker镜像pull失败两种解决办法的相关资料,文中通过代码介绍的非常详细... 目录docker 镜像 pull 失败解决办法1DrQwWCocker 镜像 pull 失败解决方法2总

找不到Anaconda prompt终端的原因分析及解决方案

《找不到Anacondaprompt终端的原因分析及解决方案》因为anaconda还没有初始化,在安装anaconda的过程中,有一行是否要添加anaconda到菜单目录中,由于没有勾选,导致没有菜... 目录问题原因问http://www.chinasem.cn题解决安装了 Anaconda 却找不到 An

Spring定时任务只执行一次的原因分析与解决方案

《Spring定时任务只执行一次的原因分析与解决方案》在使用Spring的@Scheduled定时任务时,你是否遇到过任务只执行一次,后续不再触发的情况?这种情况可能由多种原因导致,如未启用调度、线程... 目录1. 问题背景2. Spring定时任务的基本用法3. 为什么定时任务只执行一次?3.1 未启用

Python下载Pandas包的步骤

《Python下载Pandas包的步骤》:本文主要介绍Python下载Pandas包的步骤,在python中安装pandas库,我采取的方法是用PIP的方法在Python目标位置进行安装,本文给大... 目录安装步骤1、首先找到我们安装python的目录2、使用命令行到Python安装目录下3、我们回到Py

pip无法安装osgeo失败的问题解决

《pip无法安装osgeo失败的问题解决》本文主要介绍了pip无法安装osgeo失败的问题解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一... 进入官方提供的扩展包下载网站寻找版本适配的whl文件注意:要选择cp(python版本)和你py

Linux修改pip和conda缓存路径的几种方法

《Linux修改pip和conda缓存路径的几种方法》在Python生态中,pip和conda是两种常见的软件包管理工具,它们在安装、更新和卸载软件包时都会使用缓存来提高效率,适当地修改它们的缓存路径... 目录一、pip 和 conda 的缓存机制1. pip 的缓存机制默认缓存路径2. conda 的缓