Cheat Sheet - Python

Module Management

List outdated modules

pip list --outdated

Install modules

py -m pip install pyodbc
pip install pyodbc

Install specific version

py -m pip install django==3.2.1

Update module to latest version

pip install -U django

Uninstall modules

py -m pip uninstall ...
pip uninstall ... 

Show package version currently installed

pip show django 

Virtual Environments

Create virtual environment

python -m venv tutorial-env 

Activate virtual environment

tutorial-env\Scripts\activate.ps1

Rebuild environment from requirements.txt

tutorial-env\Scripts\activate.ps1
pip install -r requirements.txt