2026-06-29
Why PIP_NO_USER=1 installs to global env
2026-06-29 ~ 2026-06-29

The note is generated by GLM5.2.

A pip install run inside an activated conda env kept landing in ~/.local
instead of the env’s site-packages. This is what was going on.


TL;DR — everything you need is here

  • Symptom. Inside an activated conda env, pip install <pkg> installs to
    ~/.local/lib/python3.10/site-packages (shared across every py3.10 env)
    instead of envs/<env>/lib/.../site-packages.
  • Cause. The container image exports PIP_NO_USER=1 globally. Despite the
    name, this forces user-site installs — the NO_ is ignored. PIP_NO_USER
    behaves identically to PIP_USER.
  • Fix. Any one of:
    1
    2
    3
    
    unset PIP_NO_USER          # in ~/.bashrc (permanent, interactive shells)
    PIP_NO_USER=0 pip install …   # per-command
    pip install --no-user …       # per-command (CLI flag inverts correctly)
    

Quick reference: