**声明:**pip install安装过程慢,解决方案。亲测可用
问题:如下
(pytorch) C:\pytorch>pip install torch-1.2.0-cp36-cp36m-win_amd64.whl
Processing c:\pytorch\torch-1.2.0-cp36-cp36m-win_amd64.whl
Collecting numpy
Downloading numpy-1.19.2-cp36-cp36m-win_amd64.whl (12.9 MB)
|█████████████ | 5.3 MB 6.6 kB/s eta 0:19:04ERROR: Exception:
Traceback (most recent call last):
File “E:\program\Anaconda\envs\pytorch\lib\site-packages\pip_vendor\urllib3\response.py”, line 437, in _error_catcher
yield
File “E:\program\Anaconda\envs\pytorch\lib\site-packages\pip_vendor\urllib3\response.py”, line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
…
socket.timeout: The read operation timed out
解决方法:
时候只需要在下载的时候选择一下源就能轻松解决这个问题,比如下面的:
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/