Python is a great language! However, it doesn’t come pre-installed with Windows. Hence we download it to interpret the Python code which we write. But wait, windows don’t know where you have installed the Python so when trying to any Python code, you will get an error.
We will be using Windows10 and python3 for this article. (Most of the part is same for any other version of either windows or python)
Add Python to Windows Path
First, we need to locate where the python is being installed after downloading it. Press WINDOWS key and search for “Python”, you will get something like this:
If no results appear then Python is not installed on your machine, download it before proceeding further. Click on open file location and you will be in a location where Python is installed, Copy the location path from the top by clicking over it.
Now, we have to add the above-copied path as a variable so that windows can recognize. Search for “Environmental Variables”, you will see something like this:
Click on that
Now click the “Environmental Variables” button
There will be two categories namely “User” and “System”, we have to add it in Users, click on New button in the User section. Now, add a Variable Name and Path which we copied previously and click OK. That’s it, DONE!
Check if the Environment variable is set or not
Now, after adding the Python to the Environment variable, let’s check if the Python is running anywhere in the windows or not. To do this open CMD and type Python. If the environment variable is set then the Python command will run otherwise not.
- Windows 10 Toast Notifications with Python
- Guide to Install MongoDB with Python | Windows
- Creating Python Virtual Environment in Windows and Linux
- Opening multiple color windows to capture using OpenCV in Python
- Autorun a Python script on windows startup
- Python | How to download windows lock-screen wallpapers
- How to download and install Python Latest Version on Windows
- How to install Python on Windows?
- How to install OpenCV for Python in Windows?
- How to install Python Pycharm on Windows?
- How to install requests in Python - For windows, linux, mac
- How to Install Python Pandas on Windows and Linux?
- How to Install Python Tensorflow in Windows?
- Python - Get file id of windows file
- Convert Python Code to a Software to Install on Windows Using Inno Setup Compiler
- How to Setup Sublime Text 3 for Python in Windows?
- How to Terminate a running process on Windows in Python?
- How to Install CMake for Windows in Python?
- Get a List of Installed Softwares in Windows using Python
- How to install PIP on Windows ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.