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.
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
| Fix | What changes | Best for | Catch |
|---|---|---|---|
| Add the scripts folder to PATH | One line in your shell profile or Windows user variables | Tools you install with --user on purpose | Per Python version on macOS framework builds and Windows |
| Install into a virtual environment | Nothing global; activation puts the venv's bin or Scripts first | A project's own dependencies | Only on PATH while the venv is active |
| Install the tool with pipx | One isolated environment per app, commands exposed on PATH | Standalone command-line apps | Needs pipx ensurepath once |
| Run it as python -m tool | No PATH change at all | CI jobs, scripts, a quick one-off | Only for packages that support -m |
| py install --refresh (Windows) | Recreates the install manager's global shortcuts | Python from the Python install manager | Shortcuts folder must itself be on PATH |
| --no-warn-script-location | Hides the warning | Builds that never call the command by name | The 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 flaskVirtual 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 blackWindows 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 --versionWhen 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>(orwhere.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.