VS Code

How to Install Pip on VSCode

How to Install Pip on VSCode

Run python -m ensurepip --upgrade in the integrated terminal and pip gets installed for the Python that VSCode is using. The editor never ships with pip, since pip belongs to the interpreter.

Python has bundled pip through the ensurepip module for years, so a standard python.org install already includes it. Builds repackaged by Linux distributions are the usual exception.

On Windows, the Python documentation recommends python -m pip over the bare pip command, because the generated pip executable can be missing. The -m form also names the interpreter that receives each package, and that decides whether VSCode can import what pip installed.

VSCode Does Not Include Pip: What You Need First

The editor is a lightweight code editor that runs whichever interpreter you select, so installing it never installs a package manager.

Pip reached the standard Python distribution in version 3.4, when PEP 453 added the ensurepip module (Python documentation). Builds from python.org normally include pip, and so do virtual environments, unless a redistributor stripped ensurepip out (pip documentation).

Before any install line makes sense, you need a Python 3 interpreter (python.org, Homebrew on macOS, or the system package on Linux) and Microsoft’s Python extension from the Extension Marketplace, which adds interpreter selection and environment tools.

One more thing catches people out. Restart VSCode, or at least any terminal that was already open, after installing Python. Otherwise the new interpreter goes undetected (VS Code Python tutorial).

Windows is in the middle of a transition right now. The Python documentation marks the full installer deprecated since Python 3.14 and says it will not be produced for 3.16 or later, with the Python install manager taking over.

Pip’s installation page lists CPython 3.10 through 3.15 as supported versions, as of November 2026. If your interpreter is older than that, replace it before doing anything else.

How to Check Whether Pip Is Already Installed

Run python -m pip --version in the VSCode terminal. A version line means pip is installed, and an error means it is not.

Start by opening the integrated terminal from the View menu or with its keyboard shortcut. On Windows the check is py -m pip --version. macOS and Linux both use python3 -m pip --version.

Per the pip getting started page, a working install prints one line shaped like this: pip X.Y.Z from a site-packages path (python 3.N.N).

Read the path, not just the number. It names the interpreter that owns this pip, and that interpreter has to match the one VSCode has selected.

Why not plain pip?

Every command in this guide uses the python -m pip form for the reason given above. Typing pip on its own leaves the shell to find some pip executable, and which Python it belongs to is anyone’s guess. The -m form removes a whole class of wrong-Python mistakes.

If you see “No module named pip”, this interpreter has no pip at all. “pip is not recognized” points at the bare command instead. Either way, the install methods below are where you go next.

Which Pip Installation Method Should You Use?

Try ensurepip first. It ships inside Python and needs no download, though redistributor builds sometimes leave it out.

MethodCommandInternet neededMain limit
ensurepippython -m ensurepip --upgradeNo, pip is bundledMissing from some CPython builds
get-pip.pypython get-pip.pyYes, to download the scriptCurrent script needs Python 3.10 or newer
OS package managersudo apt install python3-pip (Linux), brew install python3 (macOS)YesDistro builds can differ from upstream pip
Reinstall Pythonpython.org installerYesSlowest fix, only for a broken interpreter

The sources disagree about Linux.

The VS Code Python tutorial tells Linux users to install pip with get-pip.py, while pip’s own documentation lists ensurepip first and warns that redistributor builds can behave differently from the documented pip. PEP 668 complicates both. On an externally managed interpreter, pip should not install into the global context by default, and it should point you to a virtual environment instead.

In practice, ensurepip goes first and the distro package second. get-pip.py is better kept for virtual environments than for the system interpreter.

It’s still the most copied fix online. It is also the heavier one, because it downloads a script and force-reinstalls pip when ensurepip would have done the job offline. I’d skip it unless the module is actually missing.

How to Install Pip With ensurepip or get-pip.py

YouTube player

Run python -m ensurepip --upgrade in the VSCode terminal. get-pip.py is the fallback for when Python reports the module missing.

Install pip with ensurepip

  1. Open the integrated terminal inside the project folder.
  2. Check the interpreter with py -3 --version on Windows or python3 --version on macOS and Linux.
  3. Run py -m ensurepip --upgrade on Windows, or python3 -m ensurepip --upgrade elsewhere.
  4. Run the version check again and confirm it prints a version and an interpreter path.
  5. Update to the newest release with python -m pip install --upgrade pip (py -m on Windows).

That last step matters because ensurepip installs the pip version bundled with that Python release, which can trail the latest pip. PEP 453 bundled pip on purpose so the installer could keep its own, faster release cycle.

The Python documentation covers two flags you will run into. --upgrade raises an existing pip to at least the bundled version. --user, which installs into the user site-packages directory, is refused inside an active virtual environment.

If the module is absent, the Python documentation points you to your distributor’s packaging notes. Which is when get-pip.py comes in.

Install pip with get-pip.py

The current get-pip.py requires Python 3.10 or newer and embeds pip 26.3 in its header, as of November 2026 (get-pip.py source).

Download the script from bootstrap.pypa.io into the folder you are working in and run it from the VSCode terminal, with py get-pip.py on Windows or python3 get-pip.py on macOS and Linux.

The script finishes with an install, upgrade and force-reinstall command, so running it on a machine that already has a working pip replaces that pip.

On Python older than 3.12 it also installs setuptools and wheel when they are missing. Pass --no-setuptools or --no-wheel to skip either one.

Pip Setup on Windows, macOS and Linux

Windows

The python.org “Install Now” option usually needs no administrator rights (a required C Runtime update is the exception) and adds the install directory to PATH when that box is ticked (Python documentation).

Install Now sets up shortcuts for the current user only, while Customize installation does an all-users install under Program Files, with the directory optionally on the system PATH. The Microsoft Store is a one-click install of the Python install manager.

Pick one source and stay with it. The Python documentation says the Store and python.org MSIX packages are “subtly different and cannot be installed at the same time”, and recommends WinGet for Store installs. Another part of the same page calls the install types compatible, so a single source is still the safe choice.

When py reports that it cannot open a file, the legacy launcher is probably installed and takes priority. Uninstalling “Python launcher” from Installed apps clears it.

macOS

The python.org installer is a universal2 package that runs natively on Apple Silicon and Intel Macs, typically from macOS 10.15 Catalina onward (Python 3.15 documentation). The PyPA packaging guide states that installers from python.org include pip.

You need an administrator account for the install, because the interpreter is available to every user of the Mac. Running Install Certificates.command from the Python folder in Applications installs SSL root certificates for the new interpreter. And with default options, python3 points to the python.org version instead of Apple’s.

That last one matters. /usr/bin/python3 is an older, incomplete Python that Apple ships for its developer tools, and the Python documentation says never to modify or delete it.

Homebrew builds are third-party. The same documentation notes that the core Python team does not maintain or support them, so they can trail the latest release.

Linux

Debian-family systems add a guard that the python.org installers for Windows and macOS lack. PEP 668, approved in June 2022 (PyPA specification), lets a distribution place an EXTERNALLY-MANAGED marker file in the standard library directory.

When pip runs outside a virtual environment and finds that file, it stops with an externally-managed-environment error. On Ubuntu 24.04 the block covers system-wide and user-specific installs alike, according to DNAnexus documentation.

The way out is a virtual environment. Create one with python3 -m venv .venv, then use its python and pip. If the venv module is missing, install the distro’s full Python package set (python3-full on Debian).

There is a shortcut, the --break-system-packages flag, and I’d leave it alone. It exists as a user override, but the specification says it should signal that using it is risky. Setting it for a whole machine only suits disposable images. DNAnexus sets PIP_BREAK_SYSTEM_PACKAGES=1 in its Ubuntu 24.04 application execution environment to turn the check off.

How to Make VSCode Use the Right Interpreter for Pip

Run Python: Select Interpreter from the Command Palette, pick the environment that owns your pip, and open a new terminal.

The Python extension then points python and pip in that terminal at the selected environment. A separate walkthrough covers switching the Python interpreter in VSCode in more depth.

  1. Open the Command Palette and run Python: Select Interpreter, or click the Python version in the status bar.
  2. Choose the entry whose path points at the project environment, not the system install.
  3. Open a new integrated terminal so the activation runs against the new choice.
  4. Run python -m pip --version and compare the printed path with the interpreter you picked.

The selected environment drives running code, debugging and IntelliSense, with one exception. A python property in launch.json overrides it for the debugger.

As of November 2026, the VS Code documentation has the editor check a fixed list of settings in this order and stop at the first match. It is more layered than most people expect.

PrioritySourceApplies when
1python-envs.pythonProjectsA project mapping exists for the folder
2python-envs.defaultEnvManagerYou set it explicitly
3python.defaultInterpreterPathLegacy fallback
4Auto-discoveryPrefers a workspace .venv, then global interpreters

Terminal behavior sits behind one setting, python-envs.terminal.autoActivationType. The default is command, which runs the activation command visibly after the terminal opens. Set it to shellStartup and activation happens through shell startup scripts, so the environment is live immediately. off skips automatic activation altogether.

Restart open terminals after changing it, or the old behavior sticks.

How to Install Pip Inside a Virtual Environment in VSCode

Create one virtual environment per project and install packages there. Keep the global interpreter for one-off scripts, since a project environment holds its own copy of pip and its own package versions.

Create the environment from VSCode

Quick Create, the plus button in the Environment Managers view, builds a .venv with the latest Python and the default manager, which is venv unless you changed it. It installs from requirements.txt or pyproject.toml when either exists, then selects the new environment (VS Code documentation).

Python: Create Environment is the custom route. It asks for the manager, the Python version, the name and the dependency source.

VSCode creates only venv and conda environments itself. Environments from pyenv, poetry and pipenv are discovered but need their own command-line tools. If you’re unsure which to pick, this piece on how venv, conda and poetry differ helps settle it.

Create it from the terminal instead

python -m venv .venv builds the environment and bootstraps pip through ensurepip by default. --without-pip skips that step, and --upgrade-deps raises pip to the latest PyPI release, available since Python 3.9.

If the version check later says pip is missing, run python -m ensurepip --upgrade inside the activated environment.

PowerShell activates with .venv\Scripts\Activate.ps1 and cmd.exe with .venv\Scripts\activate.bat, while bash and zsh use source .venv/bin/activate (Python documentation). VSCode normally does it for you, and the guide on activating a venv inside VSCode covers the manual path.

Install and pin packages

python -m pip install -r requirements.txt installs everything a project lists. To record the current state for the next machine, run python -m pip freeze > requirements.txt.

The pip user guide says pip refuses --user installs inside a default virtual environment, because user site-packages are not visible there.

And when uv handles creation, which is the default if uv is installed and python-envs.alwaysUseUv is on, uv’s documented route is uv pip install. The uv environments page does not say whether a pip executable is present, so run python -m pip --version before assuming it is.

Why Pip Fails in VSCode and How to Fix It

Find your error message in the left column and read across.

SymptomCauseFix
pip is not recognizedBare pip executable missing or off PATHRun python -m pip; py install --refresh recreates Windows shortcuts and global aliases
No module named pipThis interpreter or environment has no pippython -m ensurepip --upgrade, or the distro package
Package installs but import failsTerminal and editor use different interpretersSelect the interpreter, open a new terminal, compare paths
externally-managed-environmentDistro marked the interpreterCreate a virtual environment
Activate.ps1 will not runPowerShell execution policySet-ExecutionPolicy RemoteSigned -Scope CurrentUser

That missing pip executable is why the first row has a one-line fix. For the PATH side of the error, a dedicated walkthrough of the not-recognized error in VS Code goes through it step by step.

The last row comes from the venv documentation, which gives the execution policy command for Windows users blocked from running Activate.ps1.

None of these fixes work everywhere. ensurepip is unavailable on Android, iOS and WASI, and some CPython builds omit it (Python documentation). The macOS python.org installer needs an administrator account, which the Windows “Install Now” option usually does not. And a distro-marked interpreter refuses global installs by design, so the virtual environment is the fix and not a workaround.

Pip on VSCode FAQ

How do I install a package with pip in VSCode?

Open the integrated terminal in the activated environment and run python -m pip install followed by the package name (py -m pip on Windows).

Then run python -m pip list to confirm the package landed in the interpreter VSCode has selected.

Is pip3 different from pip?

Both launch pip, but pip3 is tied to Python 3. By default ensurepip installs pip3 and a versioned script such as pip3.12, and adds the bare pip script only with –default-pip (Python documentation).

Writing python -m pip sidesteps the naming question.

Why does pip show a permission error in VSCode?

Install somewhere your account can write to. The –user flag places packages in your own site-packages directory instead of the global one (pip user guide).

Inside a virtual environment, drop the flag, because pip refuses it there. On Ubuntu 24.04 it does not bypass the externally managed block either, per DNAnexus documentation.

How do I uninstall a package installed with pip?

Run python -m pip uninstall followed by the package name, then confirm the prompt. Add -y to skip it.

Use the same interpreter that installed the package, because each environment keeps its own set.

Setting Up Pip on VSCode in the Right Order

Pip on VSCode stays reliable when you create the project environment first and select it as the interpreter. Then read the path pip reports.

The order matters. A path check means nothing until the interpreter is selected, and a selection needs an environment to point at.

A virtual environment is also the one pip target that Windows, macOS and Linux all accept, since PEP 668 lets distributions such as Debian close the global route. The cost is one environment per project and a fresh install from requirements.txt each time.

The sequence holds as of November 2026. A distribution that drops the EXTERNALLY-MANAGED marker, or a VS Code release that changes the python-envs defaults, would change it.

With pip answering from the right interpreter, the natural next step is installing a first library such as matplotlib in VSCode.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.