问题解决

pip源问题解决

使用pip安装pytorch出现报错 pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='download.pytorch.org', port=443): Read timed out.

分析原因:

1)也许可能版本不匹配,下载命令是复制官方网站的:https://pytorch.org/get-started/previous-versions/,应该不是这个问题
2)猜测是网络问题,也就是阿里云的镜像源提供的网速不足以支撑2个G的torch安装

使用换源解决问题

临时换源
pip3 install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html -i https://pypi.tuna.tsinghua.edu.cn/simple
更改全局
pip3 config list
pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip3 config list

国内源:
豆瓣:http://pypi.douban.com/simple/
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
山东理工大学:http://pypi.sdutlinux.org/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

posted @ 2023-10-27 16:34  亦痕  阅读(7)  评论(0编辑  收藏  举报
//点击特效
//为右下角推荐推荐区域添加关注按钮 // 生成目录索引列表 //返回顶部