open-mmlab / mmcv

OpenMMLab Computer Vision Foundation
https://mmcv.readthedocs.io/en/latest/
Apache License 2.0
5.73k stars 1.61k forks source link

"ImportError: DLL load failed while importing _ext: 找不到指定的模块。" when running MMDetection progrom after installing mmcv #3041

Open Brianne-Bao opened 4 months ago

Brianne-Bao commented 4 months ago

Prerequisite

Environment

Windows11 I created an virtual environment in Anaconda:

  1. python 3.10
  2. cuda 12.3
  3. pytorch 2.2.1

I followed the official document, installing MMCV and MMEngine by

pip install -U openmim mim install mmcv git clone https://github.com/open-mmlab/mmdetection.git cd mmdetection pip install -v -e .

This is the version of mmcv I installed:

  1. mmcv 2.1.0
  2. mmdet 3.3.0
  3. mmengine 0.10.3

Reproduces the problem - code sample

the MMDetection program by

git clone https://github.com/open-mmlab/mmdetection.git

Reproduces the problem - command or script

When I ran something related to mmcv, for example:

python -c "from mmcv.utils import collect_env; print(collect_env())"

Reproduces the problem - error message

ImportError: DLL load failed while importing _ext: 找不到指定的模块。 image

Additional information

  1. I also tried to install mmcv by downloading ".whl" file and installing through pip, but I got the same version of mmcv with installing by mim.
  2. I also experienced the following error before:

    ModuleNotFoundError: No module named ‘mmcv._ext‘ I downloaded Microsoft Visual Studio and added some environment variable to the path, the error did not shown now.