#3325·mmcv

[Bug] setup.py raises `ModuleNotFoundError: No module named 'pkg_resources'` after release of setuptools 82.0

Author: boyarchenkovCreated Feb 9, 2026Updated Aug 3, 2026

Prerequisite

Environment

pip install setuptools now installs version 82.0 which doesn't have pkg_resources module. So, installing mmcv now raises ModuleNotFoundError: No module named 'pkg_resources'. in setup.py.

Reproduces the problem - code sample

No code. The error is raised during installation of mmcv.

Reproduces the problem - command or script

pip install --upgrade setuptools pip install mmcv

Reproduces the problem - error message

Collecting mmcv Using cached mmcv-2.2.0.tar.gz (479 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'error'

error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully. exit code: 1

[23 lines of output] Traceback (most recent call last): File "C:\Users\A\AppData\Local\Programs\Python\Python314\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 389, in main() ~~~~^^ File "C:\Users\A\AppData\Local\Programs\Python\Python314\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 373, in main json_out["return_val"] = hook(**hook_input["kwargs"]) ~~~~^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\A\AppData\Local\Programs\Python\Python314\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 143, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\A\AppData\Local\Temp\pip-build-env-vjk62g6p\overlay\Lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\A\AppData\Local\Temp\pip-build-env-vjk62g6p\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires self.run_setup() ~~~~~~~~~~~~~~^^ File "C:\Users\A\AppData\Local\Temp\pip-build-env-vjk62g6p\overlay\Lib\site-packages\setuptools\build_meta.py", line 520, in run_setup super().run_setup(setup_script=setup_script) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\A\AppData\Local\Temp\pip-build-env-vjk62g6p\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup exec(code, locals()) ~~~~^^^^^^^^^^^^^^^^ File "", line 5, in ModuleNotFoundError: No module named 'pkg_resources' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed to build 'mmcv' when getting requirements to build wheel

Additional information

No response