清华源: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