If pip is not recognized in VS Code on Windows 11, the message does not necessarily mean Python is missing—or that pip itself is missing. PowerShell may not be able to find the standalone pip command, VS Code may be using a different Python environment than you expect, or that environment may not have pip installed.
The safest first move is to run pip through the Python interpreter you want to use. Then check that VS Code has selected your project’s interpreter before installing anything. This avoids broad PATH changes and helps prevent packages from going into the wrong Python installation.
What the “pip is not recognized” error means
PowerShell looks for a command named pip. If it cannot find that command, it reports that the term is not recognized. But the standalone command is only one way to run pip. When pip is available inside a Python installation, python -m pip asks that particular interpreter to run its pip module directly.
That distinction matters in VS Code because a project can use a virtual environment with its own Python interpreter and packages. Installing with a different interpreter can make a package appear to install successfully while leaving your project unable to use it.
Fix “pip is not recognized” in VS Code, step by step
-
Check which Python commands work
In the VS Code terminal, which you can open from the Terminal menu, try these commands separately:
python --versionpy --versionIf one prints a Python version, that command can reach a Python installation. If
pythonfails butpyworks, you can use the launcher for a quick check. Ifpyfails, that does not by itself mean Python is unavailable: the launcher is not included with the Microsoft Store version. Use whichever command works in your setup.If neither command works, stop before trying to install a package. First select the Python interpreter you intend to use in VS Code, then open a fresh terminal and check again. The error you started with is about finding
pip; it does not establish which Python installations Windows can access. -
Run pip through Python
Try the command that matches your working Python command:
python -m pip --versionOr, if you are checking the launcher instead:
py -m pip --versionThe
-m pipform runs pip as a module belonging to that interpreter. It can work even when PowerShell cannot find a separatepipshortcut. The version check also confirms whether that interpreter can run pip.In a VS Code project, prefer
python -m pipafter selecting the project interpreter and opening a fresh integrated terminal. Do not assumepypoints to the same Python environment as VS Code; it may select a different installation. -
Select the interpreter your project uses
In VS Code, open the Command Palette and run Python: Select Interpreter. Choose the environment intended for this project. If the project uses a virtual environment, select that environment rather than an unrelated global Python installation.
Now open a new terminal in VS Code. The Python extension can activate the selected environment in the terminal, so
pythonandpipthere can refer to the selected environment. A fresh terminal matters because a terminal that was already open may not reflect the interpreter you just selected.Check the active interpreter by running:
python -c "import sys; print(sys.executable)"This prints the executable path for the Python command in that terminal. Compare it with the interpreter you selected in VS Code. Then check pip again:
python -m pip --versionUse this same terminal and
python -m pipfor package installation. A virtual environment has its own interpreter and packages, so installing through the project’s interpreter keeps the package with the environment the project uses. -
If pip is missing from the selected environment, install it there
If Python runs but
python -m pip --versionreports that pip is unavailable, use ensurepip with the selected interpreter in the fresh VS Code terminal:python -m ensurepip --upgradeThen check again with
python -m pip --version. The important detail is which Python runs the command: usingpythonin the activated project terminal targets the interpreter available there. The pip documentation also givespy -m ensurepip --upgradeas a Windows method, but use that only when the launcher targets the environment you mean to repair. Python’s documentation listspython -m ensurepip --default-pipas another possible fix when pip is not installed.A virtual environment normally includes pip when it is created, unless it was created with the option to omit pip. If ensurepip does not resolve the problem, recheck the selected interpreter and the command’s output rather than installing pip into a different Python by guesswork.
-
If only the standalone pip shortcut fails, avoid a broad PATH edit
If
python -m pip --versionworks butpip --versiondoes not, pip is available to that interpreter; PowerShell simply cannot find the standalone shortcut. Keep usingpython -m pip. It is an explicit way to run pip with the interpreter you name and does not depend on the standalone command resolving correctly.For an environment-based setup, activate the intended environment or open a fresh VS Code terminal so the selected environment is active. For global shortcuts, current Python for Windows guidance documents
py install --refreshwhere that command is available. It is not a universal fix for every installation, and it is not a substitute for selecting the right project interpreter.Avoid adding guessed folders to PATH as a first step. A PATH change can affect which Python or pip command runs, while
python -m pipmakes the interpreter choice explicit.
Quick checks for common outcomes
| What you find | What to do |
|---|---|
python works, but pip does not |
Try python -m pip --version. If it works, use python -m pip rather than editing PATH. |
py works, but python does not |
Use py to check pip, but select the project interpreter in VS Code before installing project packages. |
python -m pip says pip is unavailable |
Confirm the selected interpreter, then try python -m ensurepip --upgrade in its fresh terminal. |
| Installation succeeds, but the project cannot use the package | Check sys.executable in the VS Code terminal and make sure it matches the selected project environment. Install again with that terminal’s python -m pip. |
py is not recognized |
Do not treat that as proof Python is missing. The launcher is not included with the Microsoft Store version; try the working Python command for your installation. |
Verify that the package went into the right environment
Once python -m pip --version works in the fresh terminal for the selected interpreter, install the package your project needs:
python -m pip install <package-name>
Replace <package-name> with the package’s name. To check whether that interpreter can see it, run:
python -m pip show <package-name>
Keep using the same VS Code terminal and the same python -m pip pattern for that project. If you switch the selected interpreter, check pip again before installing: the new environment may have a different set of packages.
Conclusion
When pip is not recognized in VS Code, first find a working Python command, then run pip through the project’s selected interpreter with python -m pip. If pip is genuinely missing, use ensurepip with that same interpreter. This approach addresses the command, the environment, and the installed package without relying on a risky, one-size-fits-all PATH edit.
Sources
- Using Python on Windows — Python documentation
- Python environments in VS Code
- Installation — pip documentation
- Installing Python modules — Python documentation
- venv — Creation of virtual environments
- Python on Windows for beginners
- Python installed but doesn't seem to work, what did I “did not do” correctly?
- Pip is not recognized even after editing path
Keep this guide handy
Share it or save the link for later.
