How to Add Python to PATH on Windows: Easy Guide

How to Add Python to PATH on Windows

Interested in learning how you can add Python to PATH on Windows? Let me teach you how!

How to Add Python to PATH on Windows?

Adding Python to the PATH environment variable on Windows allows you to run Python commands from any Command Prompt window or terminal. You can automatically add Python to PATH while installing Python.

In case you missed it, you can add it manually as well. To do so, follow these steps:

Step 1: Open Users Folder

On your system, go to “Local Disk C” and then to the “Users” folder:

opening users folder

Step 2: Open your Account Folder

Next, double-click on the folder with your system account name:

opening user account folder

Step 3: Display Hidden Files

From the file explorer menu, hit on “View” and check the “Hidden items” box. As a result, a list of hidden files and folders will appear. Then, click on the “AppData” folder:

displaying system hidden files

Step 4: Open Python Folder

Follow this path “AppData > Local > Programs > Python” to navigate to the Python folder:

opening python312 folder

Step 5: Open Version Specific Python Folder

After that, click on that specific Python version folder for which you want to add a PATH. In my case, it’s “Python312”:

python312 folder

Step 6: Copy Directory Address

Click on the breadcrumb navigation bar:

python312 folder

Now, copy this folder path:

copying python312 folder address

Step 7: Add Python PATH to System Variables

Type “environment” in the Windows search bar and click on the “Edit the system environment variables” option:

opening system environment variable settings

After that, click on “Environment Variables”:

opening environment variable settings

Double-click on “Path” from the “System variables” section:

opening system variables setting

Hit “New” and paste the folder path:

adding python312 path in system variables

Optionally you can add the path to the “Scripts” folder if using Python tools like pip. For this click on the “New” button again, paste the same path, and add “\Scripts” at the end:

adding python312 Scripts path in system variables

Once done click “OK”.

Step 8: Verify Environment Variable Settings

Open the command prompt, and type “python”. If you have an output like this then the changes are successfully applied:

verifying environment variables setting

Note: Reboot your system to make changes take effect (if required).

Conclusion

To add Python to PATH on Windows, navigate to that specific folder where Python is installed. Then, open the version-specific Python folder and copy the path to this folder.

Next, search “environment” in the Windows search bar, and click on the “Edit the system environment variables” option. Navigate to the system variables section and double-click “Path”. Hit “new” and paste the Python folder path you just copied.

Do check out this blog to create a virtual environment in Python.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top