pip upgrade package command code example
Example 1: update pip
sudo pip3 install --upgrade pip
Example 2: pip upgrade package
pip install Django -U
Example 3: update pip module
pip install [package_name] -U
Example 4: upgrading a pip package while importing it
pip install [package_name] --upgrade