windows python pip code example

Example 1: how to update pip python

python -m pip install --upgrade pip

Example 2: python pip install

## To install Pip, first download get-pip.py from:
https://bootstrap.pypa.io/get-pip.py
  
## Then run the following command in the command line
## in the folder where the file has been saved.
python get-pip.py

Example 3: install pip in python

python get-pip.py

Example 4: add pip to path

import os
import sys
pipPath = f'{os.path.dirname(sys.executable)}\\Scripts'
os.system(f'setx PATH "%PATH%;{pipPath}"')

Tags:

Misc Example