. Advertisement .
..3..
. Advertisement .
..4..
To be able to run python through Windows Terminal you must have installed it in the Windows PATH environment variable before. However, this installation is also quite troublesome so many users often encounter this problem. Through the article “How to add PYTHON to PATH in Windows” we will help you easily install them.
Confirmed adding Python to the path or not?
The first step before adding python to the path you need to check if it is already installed in it.
If you don’t have python installed, you can go to python.org and select the version you want to download.
Then open Terminal and type python, then press Enter key. The command may return the error “‘python’ is not recognized as an internal or external command, operable program or batch file
”, which means that Python has not been added to the PATH variable on the machine.
Keep following this article to see how to add it.
How to add Python to path in Windows
Method 1: AUTOMATICALLY Add Python to PATH
The easiest method is to add python in the windows path right during installation. The operation is quite simple, you just need to open the installation file and check the box Add Python to PATH. Then python will automatically be added and you can run commands in it.
Method 2: MANUALLY Add Python to Windows PATH
Here are the detailed steps
1.Find Python installation path on PC
The first step you need to get its installation path is by opening the Windows search bar and typing python.exe
(don’t press Enter key). Next right-click on Python.exe that appears in the resulting menu and select the Open file location
option.
In the Explorer window that opens, click the long folder bar to the left of the search bar. Highlight and copy the entire path text to the clipboard with Ctrl + C
.
......... ADVERTISEMENT .........
..8..
2. Add Python to PATH in User variables
To add Python to the PATH in User variables, right-click This PC and select Properties
. In the Properties menu, click the Advanced system settings option then select Advanced > Environment Variables.
......... ADVERTISEMENT .........
..8..
In the User variables menu, look for a variable called Path. Then paste the path you copied earlier into the Variable value option using Ctrl + V and click OK.
If you don’t have one, you can choose New to create it. Next, in the Variable name form, enter Path and paste your Python path in the Variable value field like the following pattern:
Variable name: Path
Variable value:
C:\Users\Ron\AppData\Local\Programs\Python\Python39;C:\Users\Ron\AppData\Local\Programs\Python\Python39\Scripts
As a final step, go back to the Python installation path directory and double-click Scripts to open that folder. Next, copy its path from the path bar in the upper part of the window (next to the search bar), just like you did earlier for the Python installation path.
Once you have copied the Scripts path, go back to Environment Variables. Next, select Path variable and click Edit. Enter a semicolon after the Python executable path and paste the Scripts path you just copied after it. Then click OK.
So you have completed the steps to add python to the path.
To check if you have added successfully, you can open Terminal and type python –version then Enter. If the command returns the currently installed version of Python, it means you have successfully added it to the Windows PATH.
Conclusion
Through the article “How to add PYTHON to PATH in Windows” we have detailed steps for you to work easily. If you have any problems, please contact us immediately for support as soon as possible. Thanks for reading!
Leave a comment