Installation of Python in Windows

Installing python on a Windows Machine is a fairly straight forward process and default installation will serve most needs. This post walks you through the default installation of Python 3.9.1 on a Windows 10 system. The Python installer can be downloaded from site python.org.

  1. After downloading the executable, either double click on the executable or select –> right click and choose run as administrator to launch the installation. The below screen is displayed as a result.

2. The default installation will work for most requirements, but we will choose the custom installation for understanding purposes. So select the Customize installation to get the below displayed screen.

3. Lets keep all the selected Options in the Optional Features Screen and click on next to display the Advanced Options. If you are the sole user of the system and the administrator of the system, you can uncheck the first option. You can uncheck the Create Shortcuts for installed applications if you know where all the associated file locations and don’t need to have shortcuts for accessing the respective files. The python bin and lib locations need to be added to environment variables. If you want to handle it manually, we can uncheck it and do it manually. Please see the note at the end of the post to add python to the environment variables. Downloading debugging symbols and debug binaries is optional and check them only if you want to explore these features as part of your learning process. Will try to cover a post on these features at a later date, so for now its your option.Also the location of installation is changed to C:\Python\Python39 as its my personal choice to avoid installing in C:\Program Files, but again its your choice to change it or not.

Click on Install to start installation of python with the selected options.

4. After clicking on Install, the installation will commence and the below screen is displayed.

5. The installation is completed and the below screen is displayed.

6. Usually, Windows machines have MAX_PATH limitation of 260 characters, which you will not encounter if you follow the default installation, or custom location as listed in step 3, but if you chose to install in a location whose characters exceed 260 characters then click on the Disable path length limit option.

7. Now that Python is successfully installed in your system, its time to check whether python is installed correctly in your system. Open the command prompt and type in the command python at the command prompt to open python console as shown below. Please notice, that because the python is added to the environment variable, the python command can be given from any location in the command prompt and it should be recognizable. The execution of python command starts the python console and the window now has a >>> prompt where you can issue python commands on an interactive console. Also notice before the python prompt, python version 3.9.1 and other helpful commands are listed.

8. Alternatively python also provides an Integrated Development and Learning Environment (IDLE) which is accessible from the Windows Programs Menu post installation. Click the IDLE (Python 3.9 64 bit) icon in the menu to open the IDLE window as shown below:

9. Also take some time to explore the python directory structure, in this case C:\Python\Python39.