- Pip 安装
我在使用pip安装软件时常遇到网速极慢,链接超时自动断开。
解决方法参考别人帖子:
1)更换为国内镜像源;
2)更改链接时间限制;
以下载pytorch为例:
原始命令:
pip install torch
更换为:
pip --default-timeout=100000 install torch -i https://mirrors.aliyun.com/pypi/simple/
以下列出其他镜像源地址
(1)阿里云 https://mirrors.aliyun.com/pypi/simple/
(2)豆瓣https://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/
- conda 安装
网上教程多是将conda 源更换为国内镜像,但最近即使更换为清华源,也会发生连不上网错误,笔者发现可以进清华源官网,下载需要版本的 .tar.bz2安装包,再传于服务器中,使用命令:
conda install --use-local *.tar.bz2
即可实现离线安装