pip
TLDR
Install a package
SYNOPSIS
pip command [options] [package...]
pip install [options] package
python -m pip command [options]
DESCRIPTION
pip is the package installer for Python, used to install and manage packages from the Python Package Index (PyPI) and other repositories. It handles dependency resolution, downloading, and installation of Python packages.
Packages can be installed globally (requires root), per-user with --user, or in virtual environments (recommended). Version specifiers allow precise control: == for exact, >= for minimum, ~= for compatible versions.
The requirements.txt format, generated by pip freeze, records exact versions for reproducible installations. Modern Python recommends using python -m pip instead of the bare pip command to ensure the correct Python interpreter is used.
PARAMETERS
-U, --upgrade
Upgrade packages to newest version--user
Install to user directory (~/.local)-r, --requirement FILE
Install from requirements file--no-deps
Don't install dependencies--force-reinstall
Reinstall even if up-to-date-I, --ignore-installed
Ignore installed packages--pre
Include pre-release versions-i, --index-url URL
Base URL of package index--extra-index-url URL
Additional package index URL-e, --editable PATH
Install in editable/development mode--target DIR
Install to specified directory-y, --yes
Don't ask for confirmation-q, --quiet
Minimal output-v, --verbose
Verbose output-V, --version
Show version-h, --help
Show help
COMMANDS
install
Install packagesuninstall
Remove packageslist
List installed packagesshow
Show package informationfreeze
Output installed packages in requirements formatsearch
Search PyPI for packages (deprecated)download
Download packages without installingwheel
Build wheel packagescheck
Verify installed packages have compatible dependenciesconfig
Manage configurationcache
Manage pip's cache
CAVEATS
On Linux systems, avoid using pip with sudo to install packages globally as it can conflict with system packages. Use virtual environments or --user instead. Some distributions rename pip to pip3 for Python 3. The search command was disabled on PyPI due to abuse. Package installation may require compilation and build dependencies.
HISTORY
pip was created by Ian Bicking and first released in 2008 as a replacement for easy_install. The name is a recursive acronym: "pip installs packages". It became the standard Python package manager, included by default with Python since version 3.4. The Python Packaging Authority (PyPA) now maintains pip, continuously improving dependency resolution, security, and performance.
SEE ALSO
python(1), virtualenv(1), pipenv(1), conda(1)


