python module_error ai_generated true

ModuleNotFoundError: No module named 'setuptools'

ID: python/setuptools-module-not-found

Also available as: JSON · Markdown · 中文
80%Fix Rate
90%Confidence
0Evidence
2024-02-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.8 active — — —
3.9 active — — —
3.10 active — — —
3.11 active — — —
3.12 active — — —

Root Cause

setuptools is not installed in the current Python environment, often in fresh virtualenvs or minimal Docker images.

generic

中文

当前 Python 环境中未安装 setuptools,通常出现在新的 virtualenv 或最小化 Docker 镜像中。

Workarounds

  1. 98% success
    Install setuptools: `pip install setuptools`.
  2. 90% success
    For Python 3.12+, use `python -m ensurepip --upgrade` to bootstrap pip and setuptools.

Dead Ends

Common approaches that don't work:

  1. 95% fail

    Overkill; setuptools is a separate package.

  2. 90% fail

    Does not install setuptools.