mkdir ~/.pip
cd ~/.pip
vim ~/.pip/pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
pip install pytorch_pretrained_vit
如果上述内容依旧失效,可以考虑配置https/http_proxy。即在~/.bashrc内添加如下环境变量:
export http_proxy="http://proxy-server-ip:port/"
export https_proxy="http://proxy-server-ip:port/"