How to Add Python to the Path Variable on Windows 10

Run Python scripts in command prompt without typing the whole path.
Ash Ash (342)
2 minutes

If you want to run Python scripts on the command prompt, you’ll need to type the full Python installation path every time. To avoid this, you can add the Python installation directly to your Windows PATH variable.

The PATH variable is an environment variable that specifies a list of directories where executables can be found. If your executable—in this case, Python—can be found in one of the directories listed in your PATH environment variable, then you can call it directly without having to reference the full path.

Windows 10 PC ×1

Howchoo is reader-supported. When you buy through links on our site, we may earn a small affiliate commission at no cost to you.

Edit path variable Windows 10

Open the Start Menu, and type "Environment". Select the option labeled Edit the system environment variables. A window will open, select Environment Variables in the bottom right. The top portion of the window has a list of variables for the user currently logged in. Select the variable titled Path and then Edit…. Click New to add the Python installation path.

Now when you want to run a Python script in command prompt, you can just type Python instead of the full path.

Get the latest edition of Python in just minutes.
Ash Ash (342)
6 minutes

If it's been a while since you first installed Python, it might be time to check out the latest edition: Python 3. It has plenty of cool new features from data classes to typing enhancements.