PEP 668
A Python Enhancement Proposal that defines the externally-managed-environment marker mechanism, allowing system package managers to declare control over a Python environment and prevent pip from freely writing to system-level site-packages.
Timeline (last 90 days)
PEP 668 introduces the externally-managed-environment marker, allowing an operating system to declare via an EXTERNALLY-MANAGED file that the Python environment is managed by the system package manager and that pip must not modify it at will.
PEP 668 itself does not change filesystem permissions, so --break-system-packages or directly invoking setup.py can still bypass this protection.
The article's PoC script, when attempting to install orjson via sys.executable -m pip install inside an activated virtual environment, triggered an externally-managed-environment error, and subprocess.CalledProcessError caused the process to exit non-zero.
All Facts (3)
PEP 668 introduces the externally-managed-environment marker, allowing an operating system to declare via an EXTERNALLY-MANAGED file that the Python environment is managed by the system package manager and that pip must not modify it at will.
50%UnverifiedPEP 668 itself does not change filesystem permissions, so --break-system-packages or directly invoking setup.py can still bypass this protection.
50%UnverifiedThe article's PoC script, when attempting to install orjson via sys.executable -m pip install inside an activated virtual environment, triggered an externally-managed-environment error, and subprocess.CalledProcessError caused the process to exit non-zero.
50%