Authors: 2021-09-02 | Last update: 2022-04-09
| Created: Pip Python Package Manager Cheat Sheet¶
Pip is the package installer for Python. You can use it to install packages from the Python Package Index and other indexes.
List Installed Packages With Pip¶
pip list
List Outdated Packages¶
pip list --outdated
Instal Or Update Package To Specific Version¶
exmaple with MySQL_python package:
pip install MySQL_python==1.2.2
Update Package To The Latest Avalable Version¶
exmaple with MySQL_python package:
pip install MySQL_python --upgrade
Update Pip Itself¶
pip install --upgrade pip
Update All Packages Installed With Pip¶
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
Generate requirements.txt For a Project¶
Run this command at terminal at the root of the project:
pip freeze > requirements.txt