python如何安装torch_Python安装torch模块报错处理

Python安装torch模块报错处理

前言

安装

报错

解决

查找文档

解决方案

安装 torch

等待安装完成

安装 torchvision

提示安装完成

总结

前言

因python项目上线,需要在海外服务器上安装指定torch模块

安装

根据官网https://pytorch.org/安装提示,执行pip3 install即可。

pip3 install torch torchvision

但安装过程中发生报错,尝试多次执行pip3 install torch torchvision,仍会重置下载。

报错

$ pip3 install torch

WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.

Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.

To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.

Looking in indexes: http://ap-south-1.mirrors.cloud.aliyuncs.com/pypi/simple/

Collecting torch

Downloading http://ap-south-1.mirrors.cloud.aliyuncs.com/pypi/packages/62/01/457b49d790b6c4b9720e6f9dbbb617692f6ce8afdaadf425c055c41a7416/torch-1.5.1-cp36-cp36m-manylinux1_x86_64.whl (753.2 MB)

|████████▊ | 206.4 MB 48 kB/s eta 3:06:38ERROR: Exception:

Traceback (most recent call last):

File "/data/python3/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 425, in _error_catcher

yield

File "/data/python3/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 507, in read

data = self._fp.read(amt) if not fp_closed else b""

File "/data/python3/lib/python3.6/http/client.py", line 449, in read

n = self.readin

你可能感兴趣的:(python如何安装torch)