PlainError

Home / Coding

pip: error: externally-managed-environment

Last checked 2026-10-17 · 3 fixes · reviewed answer

TL;DRThis error appears when you try to install a Python package with pip but the system blocks it to protect important files. Modern operating systems manage Python themselves and do not want outside tools changing those files.

Likely causes

  1. Trying to install packages directly into the protected system Python instead of a private project foldermost likely
  2. Running pip on a Linux distribution or macOS setup that enforces external management of Pythonpossible

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Create a virtual environment for your projectChanges settings

    This keeps packages separate from the system Python so the error does not appear.

    python -m venv myproject
  2. Activate the virtual environmentChanges settings

    You must activate it before installing packages inside it.

    source myproject/bin/activate
  3. Install the package inside the virtual environmentChanges settings

    Run pip install as usual once the environment is active.

    pip install <package-name>

If that didn't fix it

You will continue to receive the same error and will not be able to install new Python packages without changing how you run pip.

When to see a technician

If you are working on a company or shared computer and are unsure which Python is safe to modify, ask your system administrator or a developer for help.

Did this fix it? Report a problem

Related errors