Python package installer CLI for installing, upgrading, uninstalling, and inspecting packages in Python environments.
$python -m ensurepip --upgrade
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis
pip is the canonical CLI for installing and managing Python packages inside a specific interpreter or virtual environment. It resolves packages from indexes, requirements files, VCS URLs, local projects, and archives, and it can also inspect the resulting environment.
What It Enables
- Install, upgrade, downgrade, and uninstall packages from PyPI, private indexes, requirements files, VCS URLs, local directories, or wheel and sdist archives.
- Inspect installed distributions, dependency health, and available index versions before changing an environment.
- Resolve requirements into machine-readable install reports and generate experimental
pylock.tomllockfiles for reproducible workflow tooling.
Agent Fit
- Works well in scripts and CI when the target interpreter is explicit, especially via
python -m pipinside a chosen virtualenv. - Structured output is real but uneven:
pip inspect,pip list --format=json,pip index versions --json, andpip install --reportare machine-readable, while most install and repair flows are text-first. - Best fit for agents operating inside an existing Python environment, where pip becomes the direct inspect and change layer for package state.
Caveats
- Installs can execute third-party build backends or setup code and mutate the selected environment, so unattended runs need trusted sources and guardrails.
pip lockis still experimental, and using the wrongpipbinary can modify the wrong interpreter; automation should preferpython -m pip.