Skip to main content

Pip CLI

warning

This document has been translated using machine translation without human review.

Pip is the standard package management tool in Python, used for installing and managing libraries from PyPI (Python Package Index).

How to use pip?

pip --version
python -m pip --version
python3 -m pip --version

How to install a package?

pip install package_name
pip install package_name --upgrade --force-reinstall --no-cache-dir

How to upgrade a package?

pip install --upgrade package_name

How to uninstall a package?

pip uninstall package_name

How to view the list of installed packages?

pip list

How to get detailed information about a package?

pip show package_name

How to restore packages from requirements.txt file?

pip install -r requirements.txt

How to create a requirements.txt file?

pip freeze > requirements.txt
note

Note that this command will output a list of all installed packages, including those that are probably not used.