linux:
mkdir ~/.pip
vim ~/.pip/pip.conf
windows:
%UserProfile%/pip/pip.ini
# 阿里云
[global]
index-url = https://mirrors.aliyun.com/pypi/simple
[install]
trusted-host=mirrors.aliyun.com
# 清华
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
# 中科大
[global]
index-url = https://pypi.mirrors.ustc.edu.cn/simple
[install]
trusted-host = https://pypi.mirrors.ustc.edu.cn
# 英伟达Nvidia
[global]
index-url = https://pypi.ngc.nvidia.com
[install]
trusted-host = pypi.ngc.nvidia.com
命令行设置nvidia镜像源和proxy:
pip config set global.extra-index-url https://pypi.ngc.nvidia.com
pip config set global.trusted-host pypi.ngc.nvidia.com
pip config set global.proxy socks5://IP:Port
pip config set global.proxy http://IP:Port
pip.ini
[global]
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple
extra-index-url = https://download.pytorch.org/whl/cu118 https://pypi.ngc.nvidia.com
trusted-host = mirrors.ustc.edu.cn/pypi/web/simple download.pytorch.org pypi.ngc.nvidia.com
[install]
trusted-host = mirrors.ustc.edu.cn/pypi/web/simple download.pytorch.org pypi.ngc.nvidia.com
no-cache-dir = false