Externally Managed Environment Error

error: externally-managed-environment

Quick Answer

Your system Python does not allow direct pip installs. Use a virtual environment (python -m venv) or pipx for CLI tools.

Why This Happens

Modern Linux distributions mark system Python as externally managed to prevent pip from conflicting with system packages. Installing packages with pip into system Python can break system tools.

The Problem

pip install requests  # externally-managed-environment

The Fix

python -m venv .venv
source .venv/bin/activate
pip install requests

Step-by-Step Fix

  1. 1

    Create a virtual environment

    Run python -m venv .venv.

  2. 2

    Activate the environment

    Run source .venv/bin/activate.

  3. 3

    Use pipx for CLI tools

    Install CLI tools with pipx which manages its own environments.

Bugsly catches this automatically

Bugsly's AI analyzes this error pattern in real-time, explains what went wrong in plain English, and suggests the exact fix — before your users even report it.

Try Bugsly free