How to Add Path to Python?
Python is a programming language that was first released in 1991. It has an application that can be used on multiple operating systems and developers can write and develop new code on it. Python is one of the most widely used programming languages due to the vast possibilities that it entails for the developer and extensive support.
Whenever the user enters the words “python” in the command prompt it returns an error and the whole path needs to be specified in order for it to work properly. This is because the command prompt needs to locate the “python.exe” in order to load the output and it is unable to do so unless the whole path has been specified. In this article, we will show how to permanently add a path to Python to fix this issue. After this, you will be able to run “python.exe” without having to specify the whole path.
How to Add Path to Python?
It is important to add the path to python to make it work in the command prompt without having to specify a path each time a command is run. Therefore, in this step, we will be adding the path to python permanently. After doing so, we will not have to enter the path every time. Instead, we will just have to enter “python”. In order to do so:
- Press “Windows” + “R” to launch the run prompt.
- Type in “sysdm.cpl” to open the “System Properties” window.
- Click on the “Advanced” tab and select the “Environment Variables” option.
- In the “User Variables for “Username” ” Window, click on the “PT5Home” option.
- In the “System Variable” window, click on the “Path” option and select “Edit“.
- Click on the end of the “Variable Value” Entry and add a “;“.
- Without leaving any space after the semicolon character, enter the full path to the folder in which “Python.exe” is located.
- Click on “OK” to save your settings.
- The path to python has now been added, you can always type in “Python” in the command prompt and verify that the path is added.