You should first make sure Python is correctly installed and added to the environment's path variable before attempting to run any Python programs on your Windows operating system.
I'll demonstrate how to verify if Python is installed for you in this article. If not, I will also demonstrate how to correctly install it on Windows for you. The technique works for other versions of Windows as well, however, I'll be using Windows 11 for this.
##Step 1: How to Check if You Have Python Installed in Your Windows Operating System
Use the following command to check the Python version in CMD or PowerShell:
python --version
Your machine can run any Python application just fine if you receive the version of Python that looks like the result above. The Python version in your situation can be different.
However, if you encounter the result you see above, it could indicate any of the following:
- You did not have Python installed on your computer, or
- Python's directory has not been added to the path of the
If Python is not installed on your Windows PC, you can follow the procedure below.
##Step 2: How to Install Python on Windows
To begin with, we must visit Python's official website.
Click on the Downloads section.
This page contains the most recent version. Simply click on Python 3.11.4 Download. Python may have been updated by the time you read this article, in which case the version would be different. Just download the version that is displayed.
Once the file has been downloaded, you will receive an executable file similar to this in your downloads folder. The installation wizard will launch when you simply double-click that file.
Click on Customize Installation.
Check all the boxes as indicated above. Then click on the next button.
The screen below will then appear. You can check every box if you so choose. The debugging symbols and binaries are not necessary for me. Therefore, I won't check the latter two boxes.
Additionally, I advise against moving the installation's position. Keep in mind the installation location in case you need it later. Here, we directly add Python to the environment variables. Then click Install.
Let the installation finish (it will take about two to three minutes)β¦
Simply check the button if you receive a prompt asking you to disable the path length limit. By removing the restriction on the MAX_PATH variable, it disables the path length restriction.
Nothing will be damaged or changed negatively as a result of this change. Only long path names will be supported by Python. It is advised to turn off the path length limit.
The installation has been completed successfully.
##Step 3: How to Check the Python Version Again to Confirm Python has been Installed
We must now confirm once again whether Python was correctly installed and added to the environment variables' path. launch CMD or PowerShell in order to verify that. Next, we can check the availability of Python on our machine with the following command:
python --version
Python has been installed, and the path has also been added to the environment variables successfully!
Now, to the last step.....
##Step 4: How to Check the Path of the Environment Variables
If you want to manually check the path variables, you have to open the Advanced System Settings. You can search for Advanced System Settings or open that from the Control Panel.
Go to System and Security.
Click on System.
From here, click on Advanced System Settings.
Click on Environment Variables.
Click on Path, and then click Edit.
You will see that the root directory of Python311 and the scripts directory of Python311 have already been added in the installation process, as we checked the box to do these during the installation.
Congratulations! By following the steps above, you now have Python installed on your machine. You can now pick any IDE suitable for Python and start writing and executing Python code.
Top comments (0)