配置 Jupyter Lab时报错:socket.timeout: The read operation timed out的解决。

配置Jupyter Lab时出现了以下报错:

Traceback (most recent call last):
File “c:\users\wwwxi\scoop\apps\python\current\lib\site-packages\pip_vendor\urllib3\response.py”, line 425, in _error_catcher
yield
File “c:\users\wwwxi\scoop\apps\python\current\lib\site-packages\pip_vendor\urllib3\response.py”, line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File “c:\users\wwwxi\scoop\apps\python\current\lib\site-packages\pip_vendor\cachecontrol\filewrapper.py”, line 62, in read
data = self.__fp.read(amt)
File “c:\users\wwwxi\scoop\apps\python\current\lib\http\client.py”, line 457, in read
n = self.readinto(b)
File “c:\users\wwwxi\scoop\apps\python\current\lib\http\client.py”, line 501, in readinto
n = self.fp.readinto(b)
File “c:\users\wwwxi\scoop\apps\python\current\lib\socket.py”, line 589, in readinto
return self._sock.recv_into(b)
File “c:\users\wwwxi\scoop\apps\python\current\lib\ssl.py”, line 1071, in recv_into
return self.read(nbytes, buffer)
File “c:\users\wwwxi\scoop\apps\python\current\lib\ssl.py”, line 929, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

结果也是显然没有安装成功,最后得知是网络问题。

参考解决方案是使用PyPi的国内镜像站点,这里以清华大学的为例:

https://mirror.tuna.tsinghua.edu.cn/help/pypi/

按照这里说的操作,改用这个镜像站点,一般都可以顺利下载的。

或者直接在ConEmu中键入命令行:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple jupyterlab即可。

Traceback (most recent call last): File "e:\anacoda\lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher yield File "e:\anacoda\lib\site-packages\pip\_vendor\urllib3\response.py", line 561, in read data = self._fp_read(amt) if not fp_closed else b"" File "e:\anacoda\lib\site-packages\pip\_vendor\urllib3\response.py", line 527, in _fp_read return self._fp.read(amt) if amt is not None else self._fp.read() File "e:\anacoda\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 98, in read data: bytes = self.__fp.read(amt) File "e:\anacoda\lib\http\client.py", line 447, in read n = self.readinto(b) File "e:\anacoda\lib\http\client.py", line 491, in readinto n = self.fp.readinto(b) File "e:\anacoda\lib\socket.py", line 589, in readinto return self._sock.recv_into(b) File "e:\anacoda\lib\ssl.py", line 1049, in recv_into return self.read(nbytes, buffer) File "e:\anacoda\lib\ssl.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 "e:\anacoda\lib\site-packages\pip\_internal\cli\base_command.py", line 180, in exc_logging_wrapper status = run_func(*args) File "e:\anacoda\lib\site-packages\pip\_internal\cli\req_command.py", line 245, in wrapper return func(self, options, args) File "e:\anacoda\lib\site-packages\pip\_internal\commands\install.py", line 378, in run reqs, check_supported_wheels=not options.target_dir File "e:\anacoda\lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 179, in resolve self.factory.preparer.prepare_linked_requirements_more(reqs) File "e:\anacoda\lib\site-packages\pip\_internal\operations\prepare.py", line 554, in prepare_linked_requirements_more parallel_builds=parallel_builds, File "e:\anacoda\lib\site-packages\pip\_internal\operations\prepare.py
最新发布
03-20
ERROR: Exception: Traceback (most recent call last): File "D:\python\Lib\site-packages\pip\_vendor\urllib3\response.py", line 438, in _error_catcher yield File "D:\python\Lib\site-packages\pip\_vendor\urllib3\response.py", line 561, in read data = self._fp_read(amt) if not fp_closed else b"" ~~~~~~~~~~~~~^^^^^ File "D:\python\Lib\site-packages\pip\_vendor\urllib3\response.py", line 527, in _fp_read return self._fp.read(amt) if amt is not None else self._fp.read() ~~~~~~~~~~~~~^^^^^ File "D:\python\Lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 98, in read data: bytes = self.__fp.read(amt) ~~~~~~~~~~~~~~^^^^^ File "D:\python\Lib\http\client.py", line 479, in read s = self.fp.read(amt) File "D:\python\Lib\socket.py", line 719, in readinto return self._sock.recv_into(b) ~~~~~~~~~~~~~~~~~~~~^^^ File "D:\python\Lib\ssl.py", line 1304, in recv_into return self.read(nbytes, buffer) ~~~~~~~~~^^^^^^^^^^^^^^^^ File "D:\python\Lib\ssl.py", line 1138, in read return self._sslobj.read(len, buffer) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ TimeoutError: The read operation timed out During 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 106, in _run_wrapper status = _inner_run() File "D:\python\Lib\site-packages\pip\_internal\cli\base_command.py", line 97, in _inner_run return self.run(options, args) ~~~~~~~~^^^^^^^^^^^^^^^ File "D:\python\Lib\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper return func(self, options, args) File "D:\python\Lib\site-packages\pip\_internal\commands\install.py", line 386, in run requirement_set = resolver.resolve( reqs, check_supported_wheels=not options.target_dir ) File "D:\python\Lib\site-packages\pip\_internal\resolution\resolveli
03-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值