How to Add Python to System PATH
Method 1: Using the Installer (Recommended)
- Download Python from the official site: https://www.python.org/downloads/.
- Run the Python Installer.
- Check the box that says “Add Python to PATH” at the bottom.
- Click Install Now and let the installation complete.
- Open Command Prompt (Win + R → type
cmd
→ Enter). - Type:
python --version
If it shows the version number, Python is successfully added to PATH!
- Find Python’s Install Location
- Default location:
C:\Users\YourUsername\AppData\Local\Programs\Python\PythonXX\
(XX is the Python version, e.g., Python39 for Python 3.9) - If installed elsewhere, open Command Prompt and type:
where python
This will show the installed path.
- Default location:
- Add Python to System PATH
- Press Win + R, type
sysdm.cpl
, and hit Enter. - Go to the Advanced tab and click Environment Variables.
- Under System Variables, find and select Path, then click Edit.
- Click New, then paste your Python installation path (e.g.,
C:\Python39\
or found location). - Also, add the
Scripts
folder (C:\Python39\Scripts\
).
- Press Win + R, type
- Apply and Test
- Click OK on all windows to save changes.
- Open Command Prompt and type:
python --version
If the version appears, Python is now in your PATH!
0 comments