安装上述库,
pip install -r requirements.txt
以为这样就可以成功,结果一直下载慢爆红,并且有致命错误
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
经过几次漫长的尝试后,我终于开始单个安装包下载
出现问题的有mmcv_full==1.6.2,pycocotools==2.0.5,torch_scatter==2.0.9
安装mmcv-full==1.6.2包过程报错This error originates from a subprocess, and is likely not a problem with pip
在网上尝试了很多方法之后,发现安装mmcv最简便的做法是这样的
1.先检查torch是否正确导入,以及torch的版本
进入自己的conda环境中
输入python
import torch
print(torch.__version__)
2.使用mim安装
使用 mim 安装(推荐)
mim 是 OpenMMLab 项目的包管理工具,使用它可以很方便地安装 mmcv。
pip install -U openmim
mim install mmcv_full==1.6.2
3.mmcv_full==1.6.2安装成功
pip install torch_scatter安装失败,最终whl解决
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
还是这个奇怪的错误
直接下载安装包解决的
pytorch-geometric.com/whl/torch-1.7.1+cpu.html
下载自己对应版本的torch_scatter==2.0.9
然后就是在下载路径打开终端进行安装
安装pycocotools==2.0.5,这时候error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
并且没法偷懒下安装包了,只能老实下载东西
https://visualstudio.microsoft.com/visual-cpp-build-tools/
去官网下载最新的生成工具,不能去乱七八糟的安装包下载,缺失,报错了也不好改
也下载了其他版本,仍然不能解决问题,后来就很踏实地下载了最新版
这里面还有一个坑,我看见别人都选择的前两项,我也这么选,问题仍然没解决
应该查看自己的电脑型号,按win+R键打开输入cmd回车,输入systeminfo回车,看到自己的版本信息,又重新下载了
这时候错误变了,我非常欣喜
fatal error LNK1158: cannot run 'rc.exe' (无法运行rc.exe)解决方案
应该是我不停根据别人方法下载了太多东西,把C盘的东西误删了
1.首先添加环境变量
在环境变量path中添加C:\Program Files (x86)\Windows Kits\8.1\bin\x86
2.复制粘贴文件
将rc.exe和rcdll.dll从
C:\Program Files (x86)\Windows Kits\8.1\bin\x86
复制到
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
3.pip install pycocotools==2.0.5
成功!
中间借鉴了很多大佬的分享,非常感谢。