Skip to content

[Bug] mmcv._ext builds without error, but ModuleNotFoundError on verification demo #3305

@jaquilio

Description

@jaquilio

Prerequisite

Environment

I am building mmcv from source on my Windows 11 machine by following the steps for "Build and install MMCV" given at mmcv Github page. Specifically, I followed the instructions for Full version (CUDA ops) given there.
When I execute the command python setup.py build_ext given there, the display says:
building 'mmcv._ext' extension
After that it does compile several files and does not report any error.
When I execute the python setup.py develop command given there for installing the built package(s), it runs fine and also displays:

Successfully built mmcv
Installing collected packages: mmcv
Successfully installed mmcv-2.2.0

After that I ran the following command given there to "Validate Installation":
python .dev_scripts/check_installation.py
But, that results in the following error:
ModuleNotFoundError: No module named 'mmcv._ext'

Why would that be in spite of saying "building 'mmcv._ext' extension" and not reporting any error during either the build step or installation step?

Reproduces the problem - code sample

python .dev_scripts/check_installation.py

Reproduces the problem - command or script

python .dev_scripts/check_installation.py

Reproduces the problem - error message

(train) c:\qlabRoot\projects\VtTrain\mmcv>python .dev_scripts/check_installation.py
Traceback (most recent call last):
File "c:\qlabRoot\projects\VtTrain\mmcv.dev_scripts\check_installation.py", line 4, in
from mmcv.ops import box_iou_rotated
File "C:\qlabRoot\projects\VtTrain\mmcv\mmcv\ops_init_.py", line 3, in
from .active_rotated_filter import active_rotated_filter
File "C:\qlabRoot\projects\VtTrain\mmcv\mmcv\ops\active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
'ext',
['active_rotated_filter_forward', 'active_rotated_filter_backward'])
File "C:\qlabRoot\projects\VtTrain\mmcv\mmcv\utils\ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "C:\Users\vajja\anaconda3\envs\train\Lib\importlib_init
.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'mmcv._ext'

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions