Melanie has a BS in physical science and is in grad school for analytics and modeling. She also runs a YouTube channel: The Curious Coder.
Why add to PATH?
PATH is an environment variable and by adding something to PATH, you are telling your system where to look when it's looking for a particular file. In this tutorial, I will be adding Python to my path. In essence, by adding Python to my PATH, I'm telling Windows "hey, look here for Python."
By doing this, I don't have to write a book in my command line every time I want to run a Python file, like this:
Instead, I simply type this into my command line:
It seems like a minor difference, but remember that you'll otherwise have to remember the path to your Python installation! In this tutorial, I will be using Windows 10 to get the job done. Let's get started!
How to add to Windows 10 PATH
Let's get started adding Python 3 to the PATH. You can follow along with whatever you're adding to your system's PATH.
On the lower left-hand side of your screen where it says "Type here to search", type "control panel" and navigate to your Control Panel.
Add to PATH environment variable in Windows
The window that pops up is the Control Panel. Click "System and Security" at the top left-hand side of this window. If you don't see "System and Security", on the top right click the dropdown box next to the words "View by" and switch it to Category.
Once in the System and Security tab, click "System." This will open a new window.
In this window, click "Advanced system settings." This will be on the right or the left-hand side of the window depending on your system. This will open a window called "System Properties."
Recommended for You
In the System, Properties window, click the "Environment Variables..." button.
In the User variables section, click "new."
This will open the "New user variable" screen. This is where things get a bit more difficult. Before moving further, you'll want to know the location, on your computer, where the application you're looking to add to your path is installed.
In my case, I'm adding Python 3 to the path. For me, Python 3 is located at
What you will be adding in this section will vary depending on what you're adding to your Path. In the section titled Variable name, you can put whatever you want, but try to be descriptive. I'm going to name mine "python3path". In the Variable value section, put the location of the application you want to be added to your path. I will put:
Then press "ok" on this screen. Don't forget to hit "okay" on the Environmental Variables screen as well.
Try it Out!
Now that you've added an application to your path, it's time to test it out. In my case, I have created a Python script. The Python logo shows up on my script, so I know it's connected to Python via the PATH variable I set. However, this is just one sign that it's working. The best way to try it out is to open the command prompt and run it from there.
If you have any questions, feel free to comment below. If you're having trouble at a particular section of this tutorial, do check the video guide above where I walk you through the process, step-by-step, in adding to my PATH.
I'm curious what you're adding to your PATH. Let me know in the comments below!
This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.
© 2021 Melanie Shebel