Hey guys! Today I’m going to explain how to add Python to your Windows PATH. This is a really useful thing to do, especially if you plan on using Python a lot. Let me start by explaining what the PATH is.

What is the PATH?

The PATH is an environment variable in Windows. It tells your computer where to look for program files when you try to run them from the command line. For instance, when you type “python” in your command prompt and hit Enter, Windows searches the folders listed in the PATH for the python.exe file to run.

If Python is not added to your PATH, you would have to type out the full file path to the python.exe every single time, like “C:\PythonFolder\python.exe”. That’s a hassle! Adding Python to the PATH means you can just type “python” from any directory.

Okay, now that we know what the PATH is, let’s get into how to actually add Python to it.

Adding Python to PATH on Windows 10

First thing’s first, you need to locate the folder where Python is installed on your computer. The default location is usually C:\PythonXX (where XX is the version number).

Next, right-click on the Start button and select “System”. This will open the System settings window. From there, click on “Advanced system settings” on the left panel.

In the new window that pops up, click on the “Environment Variables” button towards the bottom. This will show you all the environment variables for your system.

Under the “System Variables” section, scroll down until you find the “Path” variable and click on “Edit”.

Click “New” and paste in the folder path where Python is installed (e.g. C:\Python39). Also add a second entry with the path\Scripts folder appended (e.g. C:\Python39\Scripts).

Finally, click OK on all the remaining open windows to save the new PATH variable.

Testing if Python is Added to PATH

To test if Python was successfully added, open a new command prompt and type “python –version”. If it prints out your Python version number, congratulations! Python is now in your PATH.

If it doesn’t work, make sure the path entries were correct and try closing/reopening the command prompt. You can also try restarting your computer.

Adding Python to PATH on Older Windows

The process is fairly similar on older Windows versions like Windows 7 or 8. The main difference is that you need to right-click on “Computer” or “My Computer”, then go to Properties > Advanced System Settings > Environment Variables.

From there, the steps of editing the PATH variable are basically the same as Windows 10.

Wrapping Up

There you have it folks! Now you know how to add Python to your Windows PATH. Having Python accessible from any command line is super convenient. Anytime you need to run a Python script or use the interactive interpreter, you can do it without specifying the full file path.

Discover: Turning Off Touchscreen On Your Chromebook 

Let me know if you run into any issues with this process. I’m always happy to help out fellow Python enthusiasts! Programming can be tricky at times but stick with it – it’s an incredibly valuable skill. Happy coding!


Leave a Reply

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