Method 1: During the installation
The easiest way is to tick the box in the Python installer.
- Download the installer from python.org and run it.
- On the first screen, tick Add python.exe to PATH.

- Click Install Now.
If you already installed Python without it, run the installer again, choose Modify, and tick Add Python to environment variables. Or use method 2.
Method 2: By hand
Step 1: Find the Python folder
Python is usually in a path like this (the version number can differ):
C:\Users\username\AppData\Local\Programs\Python\Python38
Also note the Scripts folder inside it:
C:\Users\username\AppData\Local\Programs\Python\Python38\Scripts

Step 2: Open the system properties
Press the Windows key, type environment variables and open Edit the system environment variables.


Step 3: Open the variables
Click Environment Variables...

Step 4: Edit Path
Under User variables, select Path and click Edit.

Step 5: Add the folders
Click New and paste the Python folder. Click New again and paste the Scripts folder.


Step 6: Save
Click OK in all windows.


Step 7: Test it
Open a new Command Prompt (the old one does not see the change) and run:
python --version

You can also test pip --version.
python, turn it off in Settings, then Apps, then App execution aliases.Quick recap
- Tick Add python.exe to PATH in the installer.
- Or add the Python and Scripts folders to Path by hand.
- Open a new Command Prompt and run
python --version.