python config_error ai_generated true

ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

ID: python/pip-install-location-error

Also available as: JSON · Markdown · 中文
80%Fix Rate
87%Confidence
0Evidence
2025-09-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
3.11 active

Root Cause

The user is trying to use --user flag inside a virtual environment, which is not allowed because user site-packages are disabled.

generic

中文

用户尝试在虚拟环境中使用--user标志,这是不允许的,因为用户site-packages被禁用。

Workarounds

  1. 90% success
    pip install package
  2. 80% success
    python -m venv --system-site-packages venv && source venv/bin/activate && pip install --user package
  3. 85% success
    Deactivate venv and run pip install --user package

Dead Ends

Common approaches that don't work:

  1. 60% fail

    Installs into virtualenv, which may be fine but not user-level.

  2. 70% fail

    Loses isolation.

  3. 50% fail

    Exposes system packages, may conflict.