How to Add Python to the Path Variable on Windows 10

Run Python scripts in command prompt without typing the whole path.
Ash Ash (362)
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. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.

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.

John John (304)
10 minutes

Trying to run iPython inside of a virtualenv virtual environment will likely result in this error: WARNING: Attempting to work in a virtualenv.