How To Fix PIP Install Not Working?

To fix pip install not working, run pip through Python itself with py -m pip install <package> on Windows or python3 -m pip install <package> on macOS and Linux.

Advertisement

That one change clears most "pip is not recognized" and wrong-Python problems. The sections below cover the remaining errors: missing pip, PATH, permissions, Linux system Python, version mismatches, SSL and build failures.

Use the Safest Pip Command: python -m pip

The Python documentation writes every install as python -m pip install. This form runs the pip that belongs to the Python you named, so it works even when the bare pip command is missing from PATH.

  1. Open a terminal: Command Prompt or Windows Terminal on Windows, Terminal on macOS or Linux. Do not type these commands inside the Python >>> prompt.
  2. On Windows, run py -m pip --version. On macOS or Linux, run python3 -m pip --version.
  3. If a version line appears, install your package with py -m pip install SomePackage on Windows or python3 -m pip install SomePackage elsewhere.
  4. Put quotes around any version rule that uses > or <, such as py -m pip install "SomePackage>=1.0.4", so the shell does not treat it as a redirect.
  5. If the version command fails with "No module named pip", jump to the ensurepip fix below.

In a Jupyter notebook, run !{sys.executable} -m pip install SomePackage after import sys. The Packaging User Guide recommends {sys.executable} so the install lands in the notebook's own Python.

First: Confirm What Error You Are Seeing

Read the last lines of pip's output before changing anything. Match the message to a row, then go to that section.

Message you see What it means Go to
'pip' is not recognized as an internal or external command / pip: command not found pip exists, but its folder is not on PATH, or no virtual environment is active Fix "pip: command not found"
No module named pip This Python has no pip installed Fix "No Module Named pip"
NameError: name 'pip' is not defined You typed the command inside the Python interpreter, not a terminal Type exit() and rerun it in the terminal
Permission denied / access is denied pip is writing to a system folder you do not own Fix Permission Errors
error: externally-managed-environment Your Linux distribution manages this Python with its own package manager Fix "externally-managed-environment"
Could not find a version that satisfies the requirement Wrong name, a Python version the package does not support, or no build for your platform Fix "Could Not Find a Version"
SSL or certificate verify errors, timeouts, proxy errors pip cannot reach PyPI securely from this network Fix SSL, Certificate, Proxy, and Network Errors
Failed building wheel, compiler not found No prebuilt wheel exists for your setup, so pip tried to compile Fix Build Errors and Missing Compilers
Install succeeds but import fails pip installed into a different Python than the one running your code Fix Problems Caused by Multiple Python Installations

Fix “pip: command not found” or “‘pip’ is not recognized”

The bare pip command only works when its Scripts folder is on PATH or a virtual environment is active. Python's Windows documentation recommends python -m pip whenever pip itself is not found.

  1. Run py -m pip --version on Windows or python3 -m pip --version on macOS and Linux. If it prints a version, pip works and only the shortcut is missing.
  2. If you use a project virtual environment, activate it first with .venv\Scripts\activate on Windows or source .venv/bin/activate on macOS and Linux.
  3. On Windows with the Python install manager, run py install --refresh. The output names the global shortcuts folder if it is not on PATH yet.
  4. For per-user installs on Windows, run py -m site --user-site and replace site-packages at the end of the path with Scripts.
  5. Click Start, search for Edit environment variables for your account, and add that Scripts folder to your user Path variable.
  6. Close every terminal window, open a new one, and run pip --version again.

The full walkthrough for the Path editor is in how to edit environment variables on Windows 10 or 11. On Linux and macOS, add ~/.local/bin to PATH in ~/.profile for --user installs.

If python or py is also not found, or python opens the Microsoft Store, open Start > Manage app execution aliases and check that the Python (default) aliases are on. Toggle them off and on to refresh them.

Advertisement

Fix “No Module Named pip”

This means the Python you ran has no pip at all. It happens when pip was skipped during installation, removed later, or left out of a virtual environment. The standard library's ensurepip module restores it without any internet access.

  1. Run py -m ensurepip --upgrade on Windows or python3 -m ensurepip --upgrade on macOS and Linux.
  2. Add --default-pip if you also want the plain pip command created alongside pip3, for example python3 -m ensurepip --default-pip.
  3. Add --user to install pip only for your account when you are outside a virtual environment. It is not allowed inside an active one.
  4. Run py -m pip --version or python3 -m pip --version to confirm pip is back.
  5. If you get "No module named ensurepip", your Python came from a distributor that strips it. On Debian or Ubuntu, run sudo apt install python3-venv python3-pip; on Fedora, sudo dnf install python3-pip; on Arch, sudo pacman -S python-pip.

The last resort is the get-pip.py script linked from the Python Packaging User Guide. Download it with a browser over HTTPS and run python get-pip.py. Avoid it on a Python your operating system manages, because it does not coordinate with the system package manager.

macOS Python installer Custom Install screen with Install or upgrade pip checked
This macOS installer package can be skipped during a custom install, which is why some Python setups end up without pip. (Image: docs.python.org)

Upgrade Pip, Setuptools, and Wheel

An old pip may not understand newer package metadata or wheel formats, which shows up as odd version or build errors. The Packaging User Guide asks you to keep pip current before troubleshooting further.

py -m pip install --upgrade pip setuptools wheel

Upgrades pip, Setuptools and wheel for the Python that py launches. Use python3 -m pip install --upgrade pip setuptools wheel on macOS and Linux, or drop the prefix inside an active virtual environment.

Advertisement

You should see: pip ends with a "Successfully installed pip-…" line, and py -m pip --version shows the new version.

If pip cannot upgrade itself on Windows, run the upgrade through py -m pip rather than the bare pip command, as the Python documentation shows. If pip is too damaged to run, restore it first with py -m ensurepip --upgrade.

Use a Virtual Environment

A virtual environment gives each project its own Python and its own pip. The Python docs recommend one per project, and it removes most permission, PATH and version-conflict problems at once.

  1. Open a terminal in your project folder.
  2. Create the environment with python -m venv .venv on Windows or python3 -m venv .venv on macOS and Linux.
  3. Activate it: .venv\Scripts\activate in Command Prompt, .venv\Scripts\Activate.ps1 in PowerShell, or source .venv/bin/activate on macOS and Linux.
  4. Install packages with python -m pip install SomePackage. They land inside .venv, not in the system Python.
  5. Type deactivate when you are done working in the project.

If PowerShell refuses to run Activate.ps1, the venv documentation gives this fix for your account only: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.

Advertisement

If python3 -m venv fails on Ubuntu or Debian, install the missing module with sudo apt install python3-venv and create the environment again.

Fix Permission Errors

"Permission denied" or "Access is denied" means pip is trying to write into a folder owned by the system or by an administrator. The Packaging User Guide says plainly not to fix this with sudo.

  1. Best fix: create and activate a virtual environment as shown above, then rerun the install. The environment lives in your own folder, so no elevated rights are needed.
  2. Alternative for a one-off tool: install for your account only with py -m pip install --user SomePackage on Windows or python3 -m pip install --user SomePackage elsewhere.
  3. If the package's command is not found after a --user install, add the user Scripts or ~/.local/bin folder to PATH as described in the "not recognized" section.
  4. For command-line apps such as linters and formatters, use pipx instead: python3 -m pip install --user pipx, then python3 -m pipx ensurepath, then pipx install PACKAGE.
  5. Restart the terminal after ensurepath so the new PATH entry loads.

The --user flag has no effect inside a virtual environment, because installs there already go to the environment.

Fix “externally-managed-environment” on Linux

Recent Debian, Ubuntu and other distributions place an EXTERNALLY-MANAGED marker file in the system Python. pip then refuses to install into that Python so it cannot break tools the distribution depends on.

What you are installing Use this Command
A library for your own project Option 1: a virtual environment python3 -m venv .venv, source .venv/bin/activate, then python -m pip install SomePackage
A library other system programs also need Option 2: the distribution package sudo apt install python3-xyz, where xyz is the package name
A command-line application Option 3: pipx pipx install xyz, which builds a separate environment for the app
A throwaway container you control The override flag, only if you accept the risk python3 -m pip install --break-system-packages SomePackage

Avoid the --break-system-packages option unless necessary. The specification that defines it says the flag should carry a connotation that its use is risky, because it can overwrite files the system package manager owns.

Fix “Could Not Find a Version That Satisfies the Requirement”

pip prints this when nothing on the index matches both your request and your system. pip compares each release's required Python version with yours and skips releases that do not match.

  1. Check the package name. Search for it on pypi.org and copy the name exactly, because the install name can differ from the import name.
  2. Check your Python version with py -m pip --version or python3 -m pip --version. The end of the line shows which Python pip belongs to.
  3. Compare that with the Python versions listed on the package's PyPI page. If yours is too new or too old, install a supported Python and use it for this project.
  4. Check that the package supports your platform. Wheels are tagged for specific operating systems and processor types, and pip only picks tags that match your system.
  5. Remove incorrect version pins. Replace an impossible == pin with a range such as "SomePackage>=1,<2".
  6. If only a beta or release candidate exists, add --pre, because pip finds stable versions only by default.

Fix SSL, Certificate, Proxy, and Network Errors

Certificate failures, timeouts and proxy errors mean pip cannot open a secure connection to PyPI. Fix the connection rather than turning off certificate checks.

  1. Check your internet and PyPI access by opening pypi.org in a browser on the same machine.
  2. On macOS with Python from python.org, double-click Install Certificates.command in the /Applications/Python 3.14/ folder, using your own version number. It installs the SSL root certificates that Python needs.
  3. On a corporate network, ask IT whether PyPI must be reached through a proxy or an internal package mirror. The Packaging User Guide lists mirrors as the standard way to handle corporate firewalls.
  4. If IT gives you a mirror address, install from it with python -m pip install --index-url https://mirror.example.com/simple/ SomePackage.
  5. If py install from the Python install manager fails behind a proxy, set HTTPS_PROXY to your proxy's host:port in that terminal session before running it.
  6. Retry the install once the browser test and the certificate or proxy change are in place.

For machines with no internet at all, download wheels on a connected PC with python3 -m pip wheel --wheel-dir=wheelhouse SomeProject. Copy the folder over, then run python3 -m pip install --no-index --find-links=wheelhouse SomeProject.

macOS Terminal running Install Certificates.command to add SSL root certificates
Double-clicking this file in the Python folder installs the SSL root certificates and shows pip installing the certifi package. (Image: docs.python.org)

Fix Build Errors and Missing Compilers

pip prefers a prebuilt wheel. When no wheel matches your Python and platform, it downloads the source distribution and compiles it locally, which fails without the right compilers. Scientific packages can need both C and Fortran toolchains.

  1. Scroll up to the first error line, not the last one. It usually names the missing compiler, header or library.
  2. Upgrade pip, Setuptools and wheel first, because an older pip may not recognise the wheels that are available.
  3. Check the package's PyPI page for wheels matching your Python version. If wheels exist only for older versions, use one of those in a virtual environment.
  4. On Linux, install the distribution's prebuilt package instead, for example through apt or dnf.
  5. For NumPy, SciPy and similar stacks, a scientific distribution such as conda supplies prebuilt binaries and avoids local compiling.
  6. If you must build from source, install the compilers the project's own documentation names, then rerun python -m pip install SomePackage.

Fix Problems Caused by Multiple Python Installations

A package can install fine and still fail to import, because pip and python point at different Pythons. Always name the exact interpreter when you install.

Situation Command What it does
Windows, see every Python py list (or py -0p with the older launcher) Lists installed runtimes and marks the default
Windows, install for one version py -3.14 -m pip install SomePackage Uses the pip that belongs to Python 3.14
macOS or Linux, one version python3.14 -m pip install SomePackage Uses the versioned interpreter directly
Virtual environment active python -m pip install SomePackage Installs into the active environment only
Jupyter notebook !{sys.executable} -m pip install SomePackage Installs into the kernel's own Python
python and py start different versions on Windows Start > Installed apps Remove old runtimes, or choose Modify and disable their PATH options

On Windows, also open Manage app execution aliases and check that the python.exe alias is set to Python (default).

Fix Requirements.txt Installation Failures

A requirements file installs many packages in one run, so one bad line stops the whole install. Read which line pip names, then fix that line.

  1. Activate the project's virtual environment so the packages install in the right place.
  2. Change into the folder that holds requirements.txt, or pass the full path to it.
  3. Run python -m pip install -r requirements.txt.
  4. If one package fails, fix that line using the version, platform or build sections above. Loosen a pin that no longer exists for your Python.
  5. After a working install, record the exact versions with python -m pip freeze and save the output as the new requirements file.

Reinstall Python If the Installation Is Broken

Reinstall only when python -m pip and ensurepip both fail, or when Python itself will not start. Rebuild your project's virtual environments afterwards.

  1. With the Python install manager on Windows, run py install --force 3.14, using your version. It removes the existing runtime and replaces it with a clean copy.
  2. With the older full installer on Windows, open Programs and Features, select the Python entry, choose Uninstall/Change, then Repair. Repair replaces any removed or modified files.
  3. If Repair does not help, choose Uninstall there and install Python again from python.org.
  4. On macOS, run the python.org installer again, then run Install Certificates.command.
  5. On Linux, reinstall the distribution's python3-pip package with your package manager.
  6. Recreate each virtual environment with python -m venv .venv and reinstall its packages from requirements.txt.

Note that py install --update also removes packages installed globally into that runtime, although virtual environments keep working.

Python Windows installer window with Install Now and Customize installation options
The classic full installer offers a one-click Install Now or a Customize path when you reinstall Python on Windows. (Image: docs.python.org)

How to check pip is installed and working

py -m pip --version

Asks the Python that py launches to report its pip. Use python3 -m pip --version on macOS and Linux, or python -m pip --version inside an active virtual environment.

You should see: One line such as pip 25.x from ...\site-packages\pip (python 3.14). Inside a virtual environment the path contains .venv, which proves pip will install into the project.

Then install a small package and import it with the same interpreter, for example python -c "import SomePackage". No error means pip and Python agree.

Quick Troubleshooting Checklist

Check Command or place Pass looks like
Running in a terminal, not the Python prompt No >>> before your cursor A shell prompt such as C:\> or $
pip exists for this Python py -m pip --version A pip version and a Python version
pip is restored if missing py -m ensurepip --upgrade pip reported as installed
pip is current py -m pip install --upgrade pip "Successfully installed" or "already satisfied"
Project environment active .venv\Scripts\activate or source .venv/bin/activate (.venv) at the start of the prompt
Right Python chosen py list or python3.14 -m pip The version the package supports
Network reaches PyPI Open pypi.org in a browser The page loads with no certificate warning
Stale cached builds python -m pip help lists the cache commands for your pip version A fresh download or build on the next install
Scripts folder on PATH Edit environment variables for your account pip --version works in a new terminal

pip keeps a local cache of wheels it builds and reuses them on the next install. Clear pip's cache when a failed or outdated build keeps coming back after you fix the cause.

Fix pip when it still does not work

Pip installed but not working on Windows

The package exists, but its generated pip.exe shortcut is missing or its folder is not on PATH.

  1. Run py -m pip --version to confirm the module works.
  2. Run py install --refresh to recreate global shortcuts for installed packages.
  3. Add the folder named in that output to your user Path, then open a new terminal.

Pip is not installed

Python was installed without pip, or a Linux distribution ships pip as a separate package.

  1. Run python -m ensurepip --default-pip.
  2. On Debian or Ubuntu, run sudo apt update, then sudo apt install python3-venv python3-pip.
  3. Confirm with python3 -m pip --version.

Pip install not found: the installed package's command does not run

The package's command was placed in a Scripts or bin folder that is not on PATH.

  1. Activate the virtual environment you installed into.
  2. For --user installs, add the user Scripts folder or ~/.local/bin to PATH.
  3. On Windows with the install manager, run py install --refresh so new package commands get global shortcuts.

Pip install not installing: it finishes, but the import still fails

pip and your code editor or script use different Python interpreters.

  1. Print the interpreter your code runs with: python -c "import sys; print(sys.executable)".
  2. Install with that exact interpreter, for example C:\path\to\python.exe -m pip install SomePackage.
  3. Point your editor at the project's .venv interpreter so both use the same environment.

Frequently Asked Questions

How do I fix pip install not working?

Run pip through Python: py -m pip install <package> on Windows or python3 -m pip install <package> on macOS and Linux. If that reports no pip, run python -m ensurepip --upgrade. Then install inside a virtual environment to avoid permission and version conflicts.

Why can't I use pip install?

Usually the pip command is not on PATH, or pip is missing from that Python. Test with py -m pip --version or python3 -m pip --version. A version line means pip works and only the shortcut is missing. "No module named pip" means you need ensurepip.

Why can't I run pip install inside Python?

pip is a terminal command, not Python code. Typing it at the >>> prompt gives a NameError or syntax error. Type exit(), then run python -m pip install <package> in Command Prompt, PowerShell or Terminal. In Jupyter, prefix the command with !.

Why can't I install pip?

Some Linux distributions ship Python without pip or ensurepip. Install it with the package manager, such as sudo apt install python3-pip on Ubuntu or sudo dnf install python3-pip on Fedora. Python from python.org already includes pip.

How do I install pip without pip?

Use the ensurepip module that ships with Python: python -m ensurepip --upgrade. It needs no internet connection because pip is bundled inside it. If ensurepip is missing, use your distribution's pip package or the get-pip.py script linked from the Python Packaging User Guide.

How do I install a Python package without pip?

On Linux, use the distribution package, such as sudo apt install python3-xyz. On Windows and macOS, some projects publish their own installers. pipx and conda are other routes. For offline machines, pip can install from a local folder with --no-index --find-links.

Why does pip install not work on Linux with an externally-managed-environment error?

Your distribution marks its system Python as managed by its own package manager, so pip refuses to change it. Create a virtual environment with python3 -m venv .venv, activate it, and install there. Use pipx for command-line applications.

How do I check if pip is installed or not?

Run py -m pip --version on Windows or python3 -m pip --version on macOS and Linux. A line showing the pip version and the Python version means pip is installed. "No module named pip" means it is not.

Why won't pip install work without admin rights?

pip is trying to write to a system-wide folder. Install into a virtual environment, which lives in your own folder, or add --user to install for your account only. Do not use sudo for pip, as the Python Packaging User Guide advises.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *