How To Install Python (Python2 and Python3) On Windows? – POFTUT

How To Install Python (Python2 and Python3) On Windows?

Python is very popular and useful programming and scripting language. What makes Python so popular and useful is its rich modules, easy learning and usage and being cross-platform. In this tutorial, we will learn how to install Python2, Python3 interpreter, tools and libraries.

Python2 vs Python3

Python3 is the latest version of the Python programming language. Python2 is the previous version which is used for a long time. Python3 provides more performance, features, and modernity according to the Python2. But some Python projects maybe depend on Python2.

Install Python 2

Python downloads for Windows are provided from the following link where both Python2 and Python3 can be found here. But we will download the Python2 from the following link.

When we click to the Latest Python2 Release we will be redirected to the Python 2 download page which can be also accessed from the following link. We will select the architecture of Windows operating system like 32 or 64-bit. In this case, we will download the 64-bit installation MSI file.

Python2 32 and 64 Bit Installer Download

Python2 32 and 64 Bit Installer Download

If we are using Windows 10 we will see the following SmartScreen warning where we will click to the Run like below.

SmartScreen Warning For Python2

SmartScreen Warning For Python2

With the following screen, the Python2 installation will start. In the following screen, we have two options in order to select for which users we want to install Python2.

  • Install for all users will install Python2  for all users currently exist in the operating system
  • Install just for me will install Python2 for the current user and other operating system users can not use Python2.
Python 2 Install User

Python 2 Install User

In the following screen, we will specify the Python2 installation path. All files, libraries, interpreter and tools will be stored in this path. By default C:\Python27 is used but we can change whatever we want.

Specify The Python2 Installation Path

Specify The Python2 Installation Path

In the following screen, we will customize the Python2 installation. We can select the features we want to install. By default, most of the features are selected for installation which is very beneficial. We will also select the  Add python.exe to Path options which is very important.

Select Features To Install Python2

Select Features To Install Python2

  • Register Extensions will set this installation as default Python by changing and setting registry values.
  • Tcl/Tk will install features like Tkinter, IDLE, pydoc
  • Documentation will install Python HTMLHelp File
  • Utility Scripts will install some tools
  • pip will install the package manager for Python named Pip
  • Test suite will install Lib/test libraries and test suite
  • Add python.exe to Path is important because it will add the python interpreter to the operating system environment variables automatically. This will enable us to run python command from the command line directly. By default this options is not selected we will select it manually.
LEARN MORE  What Is Linux, Unix Socket?

As installing all of these things in PYthon2 we require Administrator rights which will be provided in the following screen by clicking Yes.

echo '
Provide Admin Rights For Python2 Installation

Provide Admin Rights For Python2 Installation

Following screen is about the file copy, registry change phase.

If the Python2 is installed without problem we will see the following screen which says installation is completed successfully.

Python2 Installation Successful

Python2 Installation Successful

Install Python 3

Python3 is the latest main version for the Python programming language. The minor version for Python3 is 7 which means the latest version for Python is Python3.7 . We can download the Python3 installer for the Windows operating system from the following page. There are 32 and 64-bit installers for the Python3. Also web-based installer can be used to download installation files from the internet but this will require internet access.

Python3 Installers List For Windows

Python3 Installers List For Windows

We will start the installation process of the Python3 by clicking the downloaded installer and the first screen provides us some options.

  • Install Now will install the Python3 directly without ant customization options.
  • Customize installation will provide some options for PYthon3 installation.
  • Add Python 3.7 to PATH will add Python3 interpreter and command to the Windows PATH where the python command can be run directly.

We will select the Customize Installation where we want to see and set some options.

  • Documentation will install Python documentation files which can be helpful in internet isolated situations.
  • pip will install Python package manager named Pip which can install, update and remove 3rd party Python packages, modules, and libraries.
  • tcl/tk and IDLE will install tkinter libraries with the IDLE development environment.
  • Python test suite will install standard library test suite.
LEARN MORE  How To Download, Install or Uninstall PyCharm On Windows?

We will click to Next and will see the following Advanced Options screen.

  • Install for all users will install Python3 for all the users for the operating systems
  • Associate files with Python will set the IDLE default editor for the Python or *.py extension files
  • Create shortcuts for installed applications will create shortcuts for Python interactive shell, IDLE etc.
  • Add Python to environment variables will add python interpreter and commands to the environment variables to execute them directly from command line.
  • Precompiled standard library will also install the Python standard library as of Python source code, not DLL.
  • Download debudding symbols will download debug symbols for the libraries which can be useful for debugging
  • Download debug binaries
  • Customize install location will specify the installation path for the Python3` which is the current user home directory.

Then we will click to the Install to start the installation process. During the installation, we will see a similar screen to the following where the bar will show the installation percentage.

At the we if the installation is successful we will see the following Setup was successful screen. We can click the Close button but we can also click to Diable path length limit which will bypass the MAX_PATH limitation.

Check and Verify Python Version

We can check the installed Python version in different ways. python or Python is the general name where it will redirect to the default Python version which can be Python2 or Python3.

Check and Verify Python Version

Check and Verify Python Version

We can alsı

We can check the Python2 or Python3 version in details by just running their specific commands like below.

LEARN MORE  How To Install and Use OpenSSL Library In Python Applications?


Leave a Reply

Your email address will not be published. Required fields are marked *