'pip' is not recognized as an internal or external command, operable program or batch file. code example

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

npm install -g @angular/cli

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

py -m pip install [packagename]

Example 3: add pip to path

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

Example 4: pip is not a batch command but python is installed

python -m pip install [packagename]

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

$ python -m pip --version
pip X.Y.Z from .../site-packages/pip (python X.Y)

Example 6: 'python' is not recognized as an internal or external command

Did you add python to PATH when you downloaded it?
If not, redownload it and make sure you tick the box that says 'add Python to PATH'.