我是靠谱客的博主 勤奋金毛,这篇文章主要介绍Python 安装第三方库,超时报错--Read timed out.,现在分享给大家,希望可以做个参考。

Python 安装 pillow
pip install pillow
报错如下:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Collecting pillow Downloading Pillow-5.3.0 (1.8MB) Exception: Traceback (most recent call last): File "C:python-workspacevenvlibsite-packagespip_vendorrequestspackagesurllib3response.py", line 232, in _error_catcher yield File "C:python-workspacevenvlibsite-packagespip_vendorrequestspackagesurllib3response.py", line 314, in read data = self._fp.read(amt) File "C:python-workspacevenvlibsite-packagespip_vendorcachecontrolfilewrapper.py", line 60, in read data = self.__fp.read(amt) File "C:pythonpython37Libhttpclient.py", line 447, in read n = self.readinto(b) File "C:pythonpython37Libhttpclient.py", line 491, in readinto n = self.fp.readinto(b) File "C:pythonpython37Libsocket.py", line 589, in readinto return self._sock.recv_into(b) File "C:pythonpython37Libssl.py", line 1049, in recv_into return self.read(nbytes, buffer) File "C:pythonpython37Libssl.py", line 908, in read return self._sslobj.read(len, buffer) socket.timeout: The read operation timed out During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:python-workspacevenvlibsite-packagespipbasecommand.py", line 215, in main status = self.run(options, args) File "C:python-workspacevenvlibsite-packagespipcommandsinstall.py", line 335, in run wb.build(autobuilding=True) File "C:python-workspacevenvlibsite-packagespipwheel.py", line 749, in build self.requirement_set.prepare_files(self.finder) File "C:python-workspacevenvlibsite-packagespipreqreq_set.py", line 380, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "C:python-workspacevenvlibsite-packagespipreqreq_set.py", line 620, in _prepare_file session=self.session, hashes=hashes) File "C:python-workspacevenvlibsite-packagespipdownload.py", line 821, in unpack_url hashes=hashes File "C:python-workspacevenvlibsite-packagespipdownload.py", line 659, in unpack_http_url hashes) File "C:python-workspacevenvlibsite-packagespipdownload.py", line 882, in _download_http_url _download_url(resp, link, content_file, hashes) File "C:python-workspacevenvlibsite-packagespipdownload.py", line 603, in _download_url hashes.check_against_chunks(downloaded_chunks) File "C:python-workspacevenvlibsite-packagespiputilshashes.py", line 46, in check_against_chunks for chunk in chunks: File "C:python-workspacevenvlibsite-packagespipdownload.py", line 571, in written_chunks for chunk in chunks: File "C:python-workspacevenvlibsite-packagespiputilsui.py", line 139, in iter for x in it: File "C:python-workspacevenvlibsite-packagespipdownload.py", line 560, in resp_read decode_content=False): File "C:python-workspacevenvlibsite-packagespip_vendorrequestspackagesurllib3response.py", line 357, in stream data = self.read(amt=amt, decode_content=decode_content) File "C:python-workspacevenvlibsite-packagespip_vendorrequestspackagesurllib3response.py", line 324, in read flush_decoder = True File "C:pythonpython37Libcontextlib.py", line 130, in __exit__ self.gen.throw(type, value, traceback) File "C:python-workspacevenvlibsite-packagespip_vendorrequestspackagesurllib3response.py", line 237, in _error_catcher raise ReadTimeoutError(self._pool, None, 'Read timed out.') pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out.

进入python安装目录下的Scripts内,打开控制台输入命令

复制代码
1
2
C:UserssunziAppDataLocalProgramsPythonPython36Scripts>pip3 --default-timeout=100 install -U

然后提示:
You must give at least one requirement to install (see “pip help install”)

之后就可以继续安装了

最后

以上就是勤奋金毛最近收集整理的关于Python 安装第三方库,超时报错--Read timed out.的全部内容,更多相关Python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部