Skip to content

[Bug]ModuleNotFoundError: No module named 'mmcv._ext'(Buid from source on Linux with CUDA12.8, python 3.12, pytorch2.9.1+cu128 ) #3319

@yshawen

Description

@yshawen

Prerequisite

Environment

Linux, CUDA12.8, python 3.12.12, torch 2.9.1+cu128

Reproduces the problem - code sample

python .dev_scripts/check_installation.py --> raise error "No module named 'mmcv._ext'"

Reproduces the problem - command or script

I was building mmcv from source following the next steps according to documents:

  1. git clone https://github.com/open-mmlab/mmcv.git
  2. cd mmcv
  3. pip install -r requirements/optional.txt
  4. nvcc --version --> V12.6.20
  5. gcc --version --> 12.1.0
  6. pip install -e . -v --> Successfully installed mmcv-2.2.0 mmengine-0.10.7
  7. python .dev_scripts/check_installation.py --> raise error "No module named 'mmcv._ext'"

Reproduces the problem - error message

Detailed error message after running "python .dev_scripts/check_installation.py":
Traceback (most recent call last):
File "/home/mmcv/.dev_scripts/check_installation.py", line 4, in
from mmcv.ops import box_iou_rotated
File "/home/mmcv/mmcv/ops/init.py", line 3, in
from .active_rotated_filter import active_rotated_filter
File "/home/mmcv/mmcv/ops/active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
^^^^^^^^^^^^^^^^^^^^
File "/home/mmcv/mmcv/utils/ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/miniconda3/envs/sam3/lib/python3.12/importlib/init.py", line 90, 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