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.
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.
- From the server desktop, click the Windows icon and search for “Environment Variables”. Press Enter to launch the System Properties dialog.
- This will open the System Properties dialog. Click Environment Variables to make the necessary changes.
- Create a new User Variable named: Path and Variable value: C:Users*yourusername*AppDataLocalProgramsPythonPython37 (change the variable value to match your actual installation path).
- Next, find the System variable called Path and click Edit.
- 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*AppDataLocalProgramsPythonPython37Scripts
- 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.