- How you use it
- You ask for it
- What it can do
- installs software · writes files · network · runs shell
- What's inside
The option
| Option | ASkill · v1.0.0Check the EXTERNALLY-MANAGED marker and print venv commands |
|---|---|
| How you use it | You ask for it |
| What it can do | installs software · writes files · network · runs shell |
| What's inside |
What this thread does
Do first: create the project environment with python -m venv /path/to/new/virtual/environment, then install through its Python executable rather than a bare global pip command.
Short answer
As of November 2026, pip 26.3 was uploaded November 2, 2026; use its stable documentation and current Python packaging docs. The specification directs installers to check whether they run outside a virtual environment; a standalone CLI usually belongs in pipx. Don't remove the marker to install project libraries (PEP 668, current specification).
Choose / don't choose
- Project environment: choose a project venv; don't install them into system Python or a CLI app's private pipx environment (venv).
- Standalone command-line application: choose
pipx install; pipx creates an isolated environment and exposes its commands. Don't use it as the project's importable library environment (pipx). - Distribution-owned software: choose the OS package manager's supported package. Don't use an override as an escalation after a project install fails (specification).
- Project tool selection: for uv versus standard venv, see python-venv-or-uv-and-make-my-agent-use-the-project-environment; the marker policy applies independently of that choice.
Not for: ModuleNotFoundError after a successful install, see python-modulenotfounderror-but-pip-installed-which-python-is-running.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
python -m venv | .venv is the example project directory; select the intended base interpreter before creation | Current Python docs | venv |
-m pip | After activation, use python3 -m pip on Unix/macOS or py -m pip on Windows | Current Python packaging guide | install guide |
sys.prefix / sys.base_prefix | They differ inside a venv; equality means this interpreter is outside one | Current external-management specification | spec |
EXTERNALLY-MANAGED | Installers check for the marker and whether they run outside a virtual environment; keep the distributor's marker in place | Current packaging specification | spec |
--break-system-packages | Leave unset for this repair; it explicitly permits modifying an externally managed installation | Current pip docs | pip option |
pipx install | PACKAGE should be a CLI application; pipx supplies a separate environment per app | Current pipx docs | pipx |
Order of operations
1. Create the environment with the intended Python using python -m venv /path/to/new/virtual/environment (creation). 2. Optionally activate it: source <venv>/bin/activate in POSIX bash/zsh, or <venv>\Scripts\Activate.ps1 in Windows PowerShell. Activation prepends the environment’s binary directory to PATH; it is unnecessary when using the explicit interpreter path (activation). 3. Install project requirements with python3 -m pip install -r requirements.txt on Unix/macOS, or py -m pip install -r requirements.txt on Windows, replacing the requirements file as appropriate (packaging guide). Run the project with that same interpreter. 4. If refusal persists, inspect the executable actually launched and whether its sys.prefix differs from sys.base_prefix. VIRTUAL_ENV cannot be relied upon to determine whether a virtual environment is being used (venv).
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
error: externally-managed-environment | pip targets a marked base interpreter | Use pip in a virtual environment | spec |
The discussion contains competing bypass advice; Flimm includes virtual environments and says never to remove or rename the marker. Distribution-specific package commands depend on the chosen OS.
Missing
- Historical maciek97x (venv/pipx) and inoui (marker/override) attributions are not corroborated by the current discussion; use the linked official guidance. Flimm's attribution is present.
- No OS/distributor is specified, so an exact distribution package command to repair missing venv support is not selected.
Checked
2026-11-12; pip 26.3 PyPI listing and current docs, November 2026. Python venv, packaging guide/specification, PEP 668, pip/pipx documentation and the dated discussion read. No environment creation or installation commands executed.
Started from a post by @Apoliticalboy (question); maciek97x, Flimm, inoui (answers), packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.