正常使用示例:安装numpy
pip install numpy
临时加镜像源
pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
镜像源:
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple/
如果pip版本在6.0以下,可以使用如下命令升级pip版本
pip install -U pip
问题1:安装时链接超时
在pip install之间加上 --default-timeout=1000
问题2:安装pytrch时电脑卡死
no-cache-dir是跳过缓存,如果你是Anaconda不要去删除pip的缓存
在pip install之间加上–no-cache-dir,命令的最后加上–user
例如:cuda 11.1、torch1.9.1
延长链接超时,又跳过缓存
pip --default-timeout=1000 --no-cache-dir install pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html --user