pip command not found windows code example

Example 1: pip3 not found

sudo apt-get remove python3-pip; sudo apt-get install python3-pip

Example 2: pip not found after installation

#for pip, and not pip3:
sudo apt-get install python-pip

Example 3: bash: pip: command not found

apt-get install python3-pip

Example 4: 'pip' is not recognized as an internal or external command, operable program or batch file.

py -m pip install [packagename]

Example 5: command not found: pip

apt-get install python3-pip

Example 6: add pip to path

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