python config_error ai_generated true

WARNING: The script somecli is installed in '/home/user/.local/bin' which is not on PATH.

ID: python/pip-install-scripts-not-on-path

Also available as: JSON · Markdown · 中文
80%Fix Rate
88%Confidence
0Evidence
2025-04-11First Seen

Version Compatibility

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

Root Cause

pip installed the console script into a user-level bin directory that is not included in the shell's PATH.

generic

中文

pip 将控制台脚本安装到了用户级 bin 目录,而该目录未包含在 shell 的 PATH 中。

Workarounds

  1. 95% success
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
  2. 90% success
    python -m venv .venv && source .venv/bin/activate && pip install somecli

Dead Ends

Common approaches that don't work:

  1. 80% fail

    Installs to system paths and can break the user environment; also creates root-owned files.

  2. 95% fail

    Path configuration is unrelated to reinstall behavior.

  3. 60% fail

    Only works if the package exposes a `__main__` module; many CLI packages do not.