【openmmlab】(已解决)安装mvcc出错
·
Collecting mmcv-full
Using cached mmcv-full-1.7.2.tar.gz (607 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 3
╰─> [2 lines of output]
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
错误与 OpenMP 冲突有关。可以尝试以下解决方案:
1. 设置环境变量
在 Anaconda Prompt 中,先设置环境变量,然后再安装 MMCV:
set KMP_DUPLICATE_LIB_OK=TRUE
然后尝试安装 MMCV:
pip install mmcv-full
2. 使用 Conda 安装
如果仍然无法通过 pip 安装,尝试使用 Conda 安装:
conda install -c openmmlab mmcv
3. 创建新的 Conda 环境
如果问题依旧,建议创建一个全新的 Conda 环境并安装所需库:
conda create -n mmfaster2 python=3.8 -y
conda activate mmfaster2
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
pip install mmcv-full
4. 更新相关库
确保所有相关库都是最新版本:
conda update --all
5. 检查其他库
如果有其他库(如 Intel MKL)在使用 OpenMP,也可能导致冲突。考虑更新或卸载不必要的库。
总结
- 设置环境变量
KMP_DUPLICATE_LIB_OK=TRUE。 - 尝试通过 Conda 安装
mmcv。 - 创建新的 Conda 环境并重新安装库。
- 确保所有库都是最新的。
更多推荐
所有评论(0)