pip 镜像源快速安装库方法

清华源:https://pypi.tuna.tsinghua.edu.cn/simple
阿里源:http://mirrors.aliyun.com/pypi/simple/
豆瓣源:http://pypi.douban.com/simple/
科大源:https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
源:https://pypi.python.org/simple
推荐快速安装方法:(使用pip安装包时,出现Cannot unpack file xxx的问题的解决以及pip安装速度慢或出现readtime out问题的解决。)

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn jieba
pip install 库名称 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
# --trusted-host http://pypi.douban.com 获得ssl证书的认证
pip install 库名称 -i https://pypi.douban.com/simple

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn jieba

显示已安装的频道:
conda config --show

添加频道:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --set show_channel_urls yes
conda clean -i #清除索引缓存

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --set show_channel_urls yes

conda install cudatoolkit=11.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64/

cudnn:conda install cudnn=8.0.5 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64/

conda install pytorch=0.3.0 torchvision=0.2.0 -c soumith

2 安装pytorch,cuda

在此安装torch包建议直接去torch官网.
按照上面的语句直接安装相应的版本,如需安装cuda这里可以选择想要安装的版本号

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn torch= =1.7.0+cpu torchvision= =0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

在这里插入图片描述

3 安装pycocotools库

方法一: pip install pycocotools
方法二: 直接点击下方链接,进行下载对应的.whl文件
下载链接https://pypi.tuna.tsinghua.edu.cn/simple/
Ctrl+F 搜索xxxxxxx-win版本
安装方法:pip install -i https://pypi.tuna.tsinghua.edu.cn/simplez +安装包的位置
如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simplez C:\Users\SW\Desktop\pycocotools_windows-2.0.0.2-cp38-cp38-win_amd64.whl
注:这里是自己下载.whl文件进行安装
wheel文件本质上就是zip或者rar,只不过他更加方便python的安装以及使用。在之前我们只要使用pip install wheel 就可以安装wheel。
之前直接使用pip install beautifulsoup来安装beautifulsoup,
在安装了wheel之后我们可以使使用pip install XXX.whl来安装.whl的文件了

完结

参考:
https://www.cnblogs.com/klb561/p/9271322.html
https://blog.csdn.net/qq_29750461/article/details/98498864

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值