conda install -n embodiedocc mmcv 报错如下
python
compiler version for cl: [WinError 2] 系统找不到指定的文件。
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
error: [WinError 2] 系统找不到指定的文件。
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mmcv
Running setup.py clean for mmcv
Failed to build mmcv
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (mmcv)
在之前的尝试中,我遇到了几个挑战:
-
系统中没有安装Visual Studio Build Tools,导致无法编译mmcv
-
系统中没有安装git,导致无法从GitHub源码安装
-
CUDA版本不匹配(系统中有CUDA 12.6,但mmcv预编译版本最高支持CUDA 12.1)
为了解决这些问题,我采取了以下步骤:
-
下载CUDA 11.8的mmcv
-
然后找到了OpenMMLab提供的预编译wheel文件,这些文件是为特定的CUDA和PyTorch版本组合编译的
-
最关键的是,使用了正确的安装命令,指定了与环境中CUDA 11.8和PyTorch 2.1.0匹配的预编译版本:
python
pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html --trusted-host download.openmmlab.com