python
module_error
ai_generated
true
ModuleNotFoundError: No module named 'pkg_resources'
ID: python/setuptools-pkg-resources-not-found
80%Fix Rate
85%Confidence
0Evidence
2024-12-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.8 | active | — | — | — |
| 3.9 | active | — | — | — |
| 3.10 | active | — | — | — |
| 3.11 | active | — | — | — |
| 3.12 | active | — | — | — |
Root Cause
pkg_resources is part of setuptools, but the installed setuptools version is too old or missing.
generic中文
pkg_resources 是 setuptools 的一部分,但安装的 setuptools 版本过旧或缺失。
Workarounds
-
95% success Upgrade or reinstall setuptools
pip install --upgrade setuptools
-
90% success Install setuptools in the environment
python -m pip install setuptools
Dead Ends
Common approaches that don't work:
-
Installing pkg_resources separately from PyPI
90% fail
pkg_resources is not a standalone package; it comes with setuptools.
-
Using importlib.resources instead
70% fail
This is a different API and may not be compatible with existing code.