Pip CLI
Pip is the standard package management tool for Python, used to install and manage libraries from the 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 specific package?
pip show package_name
How to restore packages from a requirements.txt file?
pip install -r requirements.txt
How to create requirements.txt file?
pip freeze > requirements.txt
note
Note that this command will list all installed packages, including those that are probably not used.