pip
Linux · Packages · reference only
What it does
Python package installer: it installs, upgrades and uninstalls libraries from the PyPI repository.
Syntax
pip orden [opciones]
Options and parameters
install paqueteInstalls a package and its dependencies.
uninstall paqueteUninstalls a package.
listLists the installed packages.
freezeLists installed packages with their exact version, in requirements.txt format.
show paqueteShows the details of an installed package.
-r ficheroWith install, installs the packages from a requirements file.
--upgradeWith install, upgrades the package if it is already installed.
--userInstalls only for your user, without touching the system.
Usage examples
pip install requestsInstalls the requests library.
pip install -r requirements.txtInstalls all of a project's dependencies.
pip listShows the installed packages.
pip freeze > requirements.txtSaves the exact versions so the environment can be reproduced.
Notes and common mistakes
- On Debian 12 you must install it with sudo apt install python3-pip.
- Debian 12 protects the system Python (PEP 668): outside a virtual environment, pip install gives the externally-managed-environment error; use python3 -m venv or pipx.