python module_error ai_generated true

错误:sitecustomize出错;设置PYTHONVERBOSE以获取回溯:ModuleNotFoundError:没有名为'setuptools'的模块

ERROR: Error in sitecustomize; set PYTHONVERBOSE for traceback: ModuleNotFoundError: No module named 'setuptools'

ID: python/pip-egg-link-corrupt

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
0证据数
2025-02-20首次发现

版本兼容性

版本状态引入弃用备注
3.9 active

根因分析

setuptools包缺失或其.egg-link文件损坏,通常由于部分安装或手动删除。

English

The setuptools package is missing or its .egg-link file is corrupted, often due to a partial install or manual deletion.

generic

解决方案

  1. 90% 成功率
    python -m ensurepip --upgrade
  2. 85% 成功率
    wget https://bootstrap.pypa.io/ez_setup.py -O - | python
  3. 95% 成功率
    python -m venv venv && source venv/bin/activate && pip install setuptools

无效尝试

常见但无效的做法:

  1. 50% 失败

    Pip itself may depend on setuptools.

  2. 80% 失败

    May have incorrect path or permissions.

  3. 90% 失败

    Many packages will fail to import.