Python was released in 1991 and has proved itself to be one of the easiest programming languages. It is a general-purpose language and that makes it first-choice for many by students, data scientists, mathematicians, engineers, and hackers. It is simple and has user-friendly syntax. This article will show you step by step guide to download and install Python in Windows 10. In addition, I will show you some verification steps after the installation is completed.
Question: Python 2 or Python 3? What should I learn as a beginner?
Answer: The same question popped up in my mind when I started learning Python. I would say, Python 2 is legacy and Python3 is the future. Both versions of Python have syntax differences and different libraries. Python 2 is the older version and should be your choice if you want to work on project that was coded in Python 2. Many organizations are still using Python 2 and many have already moved from Python 2 to Python 3.
There are many reasons as to why organizations are moving to Python 3. One reason is that Python 2 is not supported anymore. The End-of-Life date was 01-JAN-2020 which means after this date, neither new reported bugs would be fixed nor changes would be made to Python 2. In addition, there are lots of improvements done in Python 3. Therefore, as a beginner, you should start using and learning Python 3.
Download & Install Python in Windows 10
Step 1: Visit Python official website and download Python 3.X for Windows 10. The Python 3.9+ cannot be used on Windows 7 or earlier. If you are using 64-bit Windows OS, you should download a 64-bit executable file.
Step 2: After the download is finished, run the Python installer file.
Step 3: Here you can decide for 3 important things:
- Python Installation directory [Default or Customize Path].
- Additional Features to install with Python [IDLE, PIP, Documentation…].
- Adding Python 3.x to PATH [Environment Variable]
This article will cover installing Python with both default settings and Customized settings. Let us first see the Python installation with the default directory and other features.
Make sure to select Add Python 3.X to PATH checkbox. This is helpful if you want to run a python program from anywhere in the system. You don’t have to specify the full path.
Then click Install Now. When you click Install Now, it will automatically choose the default directory and install IDLE, PIP, and documentation.
Step 4: The installation is completed. However, there is one last option that you should select “Disable path length limit”. This is because Windows has limited path lengths to 260 characters and any path longer than 260 characters may not be resolved. It is recommended to disable the path length limit.
Verify Python Installation
Step 5: Verify that Python is successfully Installed.
Use “WindowsKey + R” to open run dialog box.
Type python & press Enter.
Since I chose default installation directory, It has installed Python in directory
However, I have run the python command in “C:\Users\TCPIP-ACADEMY”. This was only possible because I had selected to Add Python 3.X to PATH. Otherwise, you would need to go to the installation directory and then use the python command.
TCPIP-ACADEMY in the path is the user that is logged in. This will change for you.
Verify Python Path under Environment Variable
To verify that Python 3.X was added to “Path” under Environment Variables.
Use “Windows Key + R” to open the run dialog box. Type “sysdm.cpl” and press enter to open System Properties.
Navigate to the Advanced tab and Click Environment Variables.
Now click Edit.
You can see that the full directory paths are added here for Python.
Verify pip Installation
pip is a package manager for Python. It is a tool that will be used to install and manage additional libraries that do not come as part of the standard library. It connects to an online repository of packages, called Python Package Index.
Use “WindowsKey + R” to open the run dialog box.
And use the “pip -V” command and press Enter.
Install Python with Customize Installation
Follow these steps if you want to install Python in a directory of your own choice.
Step 1: Download Python and run its installer file.
Step 2: Make sure to select Add Python 3.X to PATH checkbox and then click Customize Installation and
Step4: You may require Python documentation and PIP in the future. PIP is used to download python packages. Therefore, you can leave the checked boxes as is and click Next.
Step5: To install the python in the directory of your own choice, remove the whole text/path from the text field. And type C:\Python and then Click Install.
The setup was successful and you may click Close.
Verify Customized Path Installation
You may verify the directory where the Python is installed.
In addition, verify the “python” command and “pip -V” in the command prompt.
And then you can verify if the Environment Variables are updated with the required Python directory path.
The Bottom Line
- Python is easy, flexible, and one of the best choices to select programming languages for beginners.
- Python 2 is in the past and is no longer support. Python 3 should be used for any future developments.
- Python is free and open-source. So, don’t wait and visit their official website to download and get started.