1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > python -m pip install --upgrade pip更新pip报错终极解决方法

python -m pip install --upgrade pip更新pip报错终极解决方法

时间:2018-08-28 01:03:43

相关推荐

python -m pip install --upgrade pip更新pip报错终极解决方法

1.报错结果

输入下面这句命令:

python -m pip install --upgrade pip

报错:

Traceback (most recent call last):File "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 331, in _error_catcheryieldFile "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 413, in readdata = self._fp.read(amt)File "D:\Python\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in readdata = self.__fp.read(amt)File "D:\Python\lib\http\client.py", line 447, in readn = self.readinto(b)File "D:\Python\lib\http\client.py", line 491, in readinton = self.fp.readinto(b)File "D:\Python\lib\socket.py", line 589, in readintoreturn self._sock.recv_into(b)File "D:\Python\lib\ssl.py", line 1052, in recv_intoreturn self.read(nbytes, buffer)File "D:\Python\lib\ssl.py", line 911, in readreturn 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:\Python\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in mainstatus = self.run(options, args)File "D:\Python\lib\site-packages\pip\_internal\commands\install.py", line 318, in runresolver.resolve(requirement_set)File "D:\Python\lib\site-packages\pip\_internal\resolve.py", line 102, in resolveself._resolve_one(requirement_set, req)File "D:\Python\lib\site-packages\pip\_internal\resolve.py", line 256, in _resolve_oneabstract_dist = self._get_abstract_dist_for(req_to_install)File "D:\Python\lib\site-packages\pip\_internal\resolve.py", line 209, in _get_abstract_dist_forself.require_hashesFile "D:\Python\lib\site-packages\pip\_internal\operations\prepare.py", line 283, in prepare_linked_requirementprogress_bar=self.progress_barFile "D:\Python\lib\site-packages\pip\_internal\download.py", line 836, in unpack_urlprogress_bar=progress_barFile "D:\Python\lib\site-packages\pip\_internal\download.py", line 673, in unpack_http_urlprogress_bar)File "D:\Python\lib\site-packages\pip\_internal\download.py", line 897, in _download_http_url_download_url(resp, link, content_file, hashes, progress_bar)File "D:\Python\lib\site-packages\pip\_internal\download.py", line 617, in _download_urlhashes.check_against_chunks(downloaded_chunks)File "D:\Python\lib\site-packages\pip\_internal\utils\hashes.py", line 48, in check_against_chunksfor chunk in chunks:File "D:\Python\lib\site-packages\pip\_internal\download.py", line 585, in written_chunksfor chunk in chunks:File "D:\Python\lib\site-packages\pip\_internal\utils\ui.py", line 159, in iterfor x in it:File "D:\Python\lib\site-packages\pip\_internal\download.py", line 574, in resp_readdecode_content=False):File "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 465, in streamdata = self.read(amt=amt, decode_content=decode_content)File "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in readraise IncompleteRead(self._fp_bytes_read, self.length_remaining)File "D:\Python\lib\contextlib.py", line 130, in __exit__self.gen.throw(type, value, traceback)File "D:\Python\lib\site-packages\pip\_vendor\urllib3\response.py", line 336, in _error_catcherraise ReadTimeoutError(self._pool, None, 'Read timed out.')pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='', port=443): Read timed out.

2.原因分析

下载超时了,找国内镜像。如:

python -m pip install --upgrade pip -i /simple

完美解决。

3.其他国内镜像

阿里云:/pypi/simple/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。