Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Node.js, PHP and APIs · Comparison

pip installs a command into a folder the terminal does not search

Short answer

pip put a command launcher in a folder missing from PATH: usually the per-user bin folder after a --user install, or on Windows a runtime's Scripts folder. You can add that folder to PATH, install into a virtual environment or with pipx instead, call the tool with python -m, or on Windows run py install --refresh. Silencing the warning changes nothing.

  • Applies to pip 26.3, Python 3.10 to 3.15, Python install manager 26 on Windows
  • Updated
  • By Maaz Zindani, Senior Software Engineer

The package installed correctly. The warning is about its command-line entry point: pip created a small launcher such as flask or black and put it in a scripts folder, then compared that folder against every entry in PATH and found no match. pip's own source shows two exceptions where it stays quiet: when the folder is already on PATH, and when the launcher sits next to the Python interpreter that ran pip, which is the case inside any virtual environment.

So the warning almost always follows an install outside a virtual environment. Whether to put that folder on PATH or install differently depends on what the tool is for, and the table compares the choices.

At a glance

Pick by how the command will be used, not by which line makes the warning disappear.
FixWhat changesBest forCatch
Add the scripts folder to PATHOne line in your shell profile or Windows user variablesTools you install with --user on purposePer Python version on macOS framework builds and Windows
Install into a virtual environmentNothing global; activation puts the venv's bin or Scripts firstA project's own dependenciesOnly on PATH while the venv is active
Install the tool with pipxOne isolated environment per app, commands exposed on PATHStandalone command-line appsNeeds pipx ensurepath once
Run it as python -m toolNo PATH change at allCI jobs, scripts, a quick one-offOnly for packages that support -m
py install --refresh (Windows)Recreates the install manager's global shortcutsPython from the Python install managerShortcuts folder must itself be on PATH
--no-warn-script-locationHides the warningBuilds that never call the command by nameThe command is still not found

Find the folder pip is talking about

Python can tell you where it puts commands for the current interpreter and for the per-user scheme. The folder in the warning matches one of them. Python's sysconfig documentation places the user scheme's commands in userbase/bin on Linux and in macOS framework builds, and in userbase\PythonXY\Scripts on Windows; note that the last two include the Python version, so each new Python release gets a new folder.

Interpreter scripts folder, user scripts folder, and PATH

python3 -c "import sysconfig as s; print(s.get_path('scripts')); print(s.get_path('scripts', s.get_preferred_scheme('user')))"
python3 -m site --user-base
echo "$PATH" | tr ':' '\n'

If the warning also says Defaulting to user installation because normal site-packages is not writeable, pip chose the user scheme itself because it could not write to the system folder. You did not have to pass --user for this to happen.

Adding the folder to PATH, written so every program sees it

Put the exact folder from the first command into the start-up file of your shell, as an absolute path. Write it with $HOME, not a quoted ~. pip compares PATH entries after resolving them to real paths but never expands a tilde, so "~/.local/bin" in PATH does not count and pip adds the extra NOTE line about entries starting with ~. Your shell may still find the command; other programs that read PATH literally will not.

Absolute path through $HOME

# ~/.zshrc or ~/.bashrc
export PATH="$HOME/.local/bin:$PATH"
# then, in a new terminal
command -v flask

Virtual environments and pipx: avoiding the folder entirely

For anything that belongs to a project, a virtual environment is the cleaner answer. Its launchers go into the environment's own bin or Scripts folder, pip does not warn there, and activation puts that folder first on PATH.

For a tool you want everywhere, such as a formatter or an HTTP client, pipx is built for the job: it installs each application into its own isolated environment and exposes its commands on PATH, and its install instructions end with pipx ensurepath to set that PATH entry up once. It also suits recent Debian and Ubuntu releases, where pip refuses to install into the system Python at all; see the externally-managed-environment page.

python3 -m venv .venv && . .venv/bin/activate && pip install flask
# or, for a standalone tool
pipx install black

Windows with the Python install manager

Python's Windows documentation answers this exact case: new packages do not get global shortcuts automatically from the Python install manager, and uninstalled ones keep theirs. py install --refresh updates the global shortcuts for newly installed packages. The documentation adds that the global shortcuts folder must be on PATH, and that the command output shows it if it is not. Activate a virtual environment first if you meant to install into one, since that is the other common reason for a missing command on Windows.

py install --refresh
where.exe flask
py -m flask --version

When suppressing the warning is the right call

In a Docker build or CI job that calls every tool through python -m, or installs into a prefix whose bin folder you add to PATH later in the image, the warning is noise. --no-warn-script-location exists for that. Anywhere a person will type the command, hiding the warning only postpones a command not found.

Checking that the command is really reachable

  • Open a new terminal, not the one you edited the profile in, and run command -v <tool> (or where.exe <tool> on Windows): it should print the full path.
  • Install another package with a command into the same place: pip should say nothing about PATH.
  • If the command runs but is an old version, another folder earlier on PATH holds a launcher with the same name; the path printed above shows which one wins.

Which to pick

  • The package is installed; only its launcher's folder is off PATH.
  • Project dependencies: virtual environment. Standalone tools: pipx.
  • Adding the folder by hand: absolute path via $HOME, never a quoted ~.
  • Windows install manager: py install --refresh, then check the shortcuts folder is on PATH.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Next step

Want a second pair of eyes on it?

Send me the error and what changed before it started. I reply within 24 hours.