How Do I Set System Variable Path for Python on Windows?

Reading Time: 2 minutes

Python is a powerful programming language that is scalable and uses code that is readable and clear for all types of projects. Python is also available across a number of operating systems, making it a popular choice for developers. If you are using Python on your Windows operating system, you may need to adjust your System Environment Variables to simplify utilizing Python on your server.

The latest installers for Python for Windows can set the System Environment Variable Path automatically if you choose that option during the installation. To verify if this setting is correct, open an administrative command prompt (right-click on the command prompt and choose “run as administrator”) and type the word python, then press Enter. If the System Variable Path is correctly set, you should receive output similar to what is shown below.

python output screen

Note:
Python software installation is considered Beyond Scope Support. This means it is not covered under our managed support, but we will do what we reasonably can to assist. It may take longer for us to assist as the SLA for Beyond Scope Support is different than our managed services. Find out more in our article What Is Beyond Scope Support?

If you receive an error indicating that the command is unknown, but you’ve confirmed that Python is installed and can be launched from its directory, you will probably need to add the Python variables to the System Environment Variables. By following these quick steps, you’ll be able to access Python from any command prompt.

  1. From the server desktop, click the Windows icon and search for “Environment Variables”. Press Enter to launch the System Properties dialog.
    system variables launch link
  2. This will open the System Properties dialog. Click Environment Variables to make the necessary changes.
    system properties screenshot
  3. Create a new User Variable named: Path and Variable value: C:\Users\*yourusername*\AppData\Local\Programs\Python\Python37 (change the variable value to match your actual installation path).
    new path link highlighted
  4. Next, find the System variable called Path and click Edit.

    system variables screen, edit button highlighted

  5. Create a New entry that matches the Path variable that you created. Add \Scripts to the end of the entry (the new entry should look like C:\Users\*yourusername*\AppData\Local\Programs\Python\Python37\Scripts\
    edit system variable path screenshot
  6. You can verify that you have completed this successfully by opening a new administrative command prompt from any location and typing “python” (without the quotes). You should receive a response similar to what is shown above.

Author Bio

About the Author: David Richards

David Richards has been an educator, a technology director, and now a Windows administrator for 20+ years. He’s an English major with a love for technology and helping others find ways to use technology more effectively. In his free time, Dave loves to read, play games, and spend time his family.

Get 33% off the first 3 months on a new Dedicated server! Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7x365 Support