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.
Python 2 or Python 3 – What should I learn as a beginner?
Python 2 is the 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 a project that was coded in Python 2. There are organizations that are still using Python 2 and many have already migrated from Python 2 to Python 3.
There are many reasons 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 on Windows 10
Step 1: Visit the official Python website and download Python 3.X for Windows 10. Python 3.9+ cannot be used on Windows 7 or earlier. If you use a 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 on 3 essential 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.
Python Installation with Default Directory
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 the run dialog box. Type “cmd”
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.
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. Type “cmd” 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
Step 3: 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.
Step 4: 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.
- Python is free and open-source.
- As a beginner, Python is the best choice to start with.
- Python 2 is in the past and is no longer supported. Python 3 should be used for any future developments.
- Python is a cross-platform language: a Python program written on a Windows computer may be run on a Linux system and vice versa.