gpt4 book ai didi

python - pip安装selenium出错

转载 作者:太空宇宙 更新时间:2023-11-03 15:04:24 24 4
gpt4 key购买 nike

C:\Users\Suyash>pip install selenium
Collecting selenium
Downloading selenium-3.4.3-py2.py3-none-any.whl (931kB)
72% |███████████████████████▏ | 675kB 3.2kB/s eta 0:01:20Exception:
Traceback (most recent call last):
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 232, in _error_catcher
yield
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 314, in read
data = self._fp.read(amt)
File "c:\python\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 60, in read
data = self.__fp.read(amt)
File "c:\python\lib\http\client.py", line 449, in read
n = self.readinto(b)
File "c:\python\lib\http\client.py", line 493, in readinto
n = self.fp.readinto(b)
File "c:\python\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "c:\python\lib\ssl.py", line 1002, in recv_into
return self.read(nbytes, buffer)
File "c:\python\lib\ssl.py", line 865, in read
return self._sslobj.read(len, buffer)
File "c:\python\lib\ssl.py", line 625, in read
v = 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\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\python\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "c:\python\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "c:\python\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "c:\python\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "c:\python\lib\site-packages\pip\download.py", line 659, in unpack_http_url
hashes)
File "c:\python\lib\site-packages\pip\download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "c:\python\lib\site-packages\pip\download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "c:\python\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "c:\python\lib\site-packages\pip\download.py", line 571, in written_chunks
for chunk in chunks:
File "c:\python\lib\site-packages\pip\utils\ui.py", line 139, in iter
for x in it:
File "c:\python\lib\site-packages\pip\download.py", line 560, in resp_read
decode_content=False):
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 357, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 324, in read
flush_decoder = True
File "c:\python\lib\contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.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.

即使我使用 pip3.6 或 pip3,我也会遇到类似的错误

C:\Users\Suyash>pip3.6 install selenium
Collecting selenium
Downloading selenium-3.4.3-py2.py3-none-any.whl (931kB)
49% |███████████████▉ | 460kB 3.4kB/s eta 0:02:21Exception:
Traceback (most recent call last):
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 232, in _error_catcher
yield
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 314, in read
data = self._fp.read(amt)
File "c:\python\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 60, in read
data = self.__fp.read(amt)
File "c:\python\lib\http\client.py", line 449, in read
n = self.readinto(b)
File "c:\python\lib\http\client.py", line 493, in readinto
n = self.fp.readinto(b)
File "c:\python\lib\socket.py", line 586, in readinto
return self._sock.recv_into(b)
File "c:\python\lib\ssl.py", line 1002, in recv_into
return self.read(nbytes, buffer)
File "c:\python\lib\ssl.py", line 865, in read
return self._sslobj.read(len, buffer)
File "c:\python\lib\ssl.py", line 625, in read
v = 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\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\python\lib\site-packages\pip\commands\install.py", line 324, in run
requirement_set.prepare_files(finder)
File "c:\python\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "c:\python\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
File "c:\python\lib\site-packages\pip\download.py", line 821, in unpack_url
hashes=hashes
File "c:\python\lib\site-packages\pip\download.py", line 659, in unpack_http_url
hashes)
File "c:\python\lib\site-packages\pip\download.py", line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File "c:\python\lib\site-packages\pip\download.py", line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File "c:\python\lib\site-packages\pip\utils\hashes.py", line 46, in check_against_chunks
for chunk in chunks:
File "c:\python\lib\site-packages\pip\download.py", line 571, in written_chunks
for chunk in chunks:
File "c:\python\lib\site-packages\pip\utils\ui.py", line 139, in iter
for x in it:
File "c:\python\lib\site-packages\pip\download.py", line 560, in resp_read
decode_content=False):
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 357, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 324, in read
flush_decoder = True
File "c:\python\lib\contextlib.py", line 100, in __exit__
self.gen.throw(type, value, traceback)
File "c:\python\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.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.

这是我尝试安装 selenium 模块时遇到的错误我尝试卸载并重新安装 python 也添加到路径文件夹,但仍然出现这些错误我目前使用的是 Windows 10(最新更新),所以我认为这不应该是一个问题,请帮助修复

提前感谢您的帮助

最佳答案

ReadTimeoutErrors 主要是由于网络问题而发生的。如果互联网连接中断或速度太慢,则可能会发生这种情况。一种可能的解决方案是在 pip install 命令中传递增加的 default-timeout 标志,如下所示:

pip install selenium --default-timeout=100

如果 100 不行,也可以尝试使用 200。

关于python - pip安装selenium出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44786111/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com