pip path windows code example
Example 1: how to find where python is located
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\\Python25'
Example 2: add pip to path
import os
import sys
pipPath = f'{os.path.dirname(sys.executable)}\\Scripts'
os.system(f'setx PATH "%PATH%;{pipPath}"')
Example 3: pip is not a batch command but python is installed
python -m pip install [packagename]
Example 4: pip path windows 10
C:\Users\[User Name]\AppData\Local\Programs\Python\Python39\