分享一个解决方法:
1. 登录Pytorch官网 PyTorch
2. 选择自己安装的方式,获得代码(红色框出部分)

有建议和问题欢迎留言,保持更新
更新一个报错,今天新起了一个环境遇到的:
ERROR: Exception:
Traceback (most recent call last):
File "/opt/miniconda3/envs/python37/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
yield
File "/opt/miniconda3/envs/python37/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/opt/miniconda3/envs/python37/lib/python3.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "/opt/miniconda3/envs/python37/lib/python3.7/http/client.py", line 461, in read
n = self.readinto(b)
File "/opt/miniconda3/envs/python37/lib/python3.7/http/client.py", line 505, in readinto
n = self.fp.readinto(b)
File "/opt/miniconda3/envs/python37/lib/python3.7/socket.py", line 589, in readinto
return self._sock.recv_into(b)
File "/opt/miniconda3/envs/python37/lib/python3.7/ssl.py", line 1071, in recv_into
return self.read(nbytes, buffer)
File "/opt/miniconda3/envs/python37/lib/python3.7/ssl.py", line 929, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
解决方法:
先装numpy再装torch
这篇博客分享了在安装PyTorch时遇到的错误和解决方案。首先建议从PyTorch官网选择合适的安装方式获取代码,然后描述了一个具体的安装过程中出现的`socket.timeout`错误。解决方法是先安装numpy,然后再尝试安装PyTorch。

被折叠的 条评论
为什么被折叠?



