How to Download Python for Windows Step-by-Step
Python is one of the most popular programming languages, widely used for various purposes in different business sectors.
It is an integral part for developers, data scientists, and data engineers who utilize Python for data analysis, statistical analysis, and machine learning model development.
By default, Python is usually not installed on Windows. In this guide, we will go through a detailed step-by-step process of how to install Python on Windows.
Let's get started!
Method #1: Installing Python from its Website
Firstly, to install Python on Windows, visit the official Python website and click the "Download" button.
Once the file is downloaded, open it, and you will see the following screen:
It is important to select "Add python.exe to PATH".
Then, click "Install Now".
When the installation is complete and you see the message "Setup was successful" on your computer, you can test if everything is working correctly by clicking the Windows icon, essentially the start button.
Choose and click the third icon labeled "Python 3.11 (64-bit)"*, which will open a command-line interface where you can write your first Python command.
Note: New versions are constantly released, so depending on the version you have downloaded, it may display a different version.
As shown in the example in the image above, we have written the command print ("Hello, Big Blue!") and by pressing the enter key, it "runs".
Now, let's explore an alternative method for installing Python, apart from the official website.
Method #2: Installing Python via winget
In Windows 11, another way to install Python on your computer is through winget. Winget is a package manager for Windows programs, included in Windows 11.
To install Python via winget, open a terminal such as command line, PowerShell, or Windows Terminal. Then, run the command "winget search Python.Python" to see the available Python versions.
Once you find the desired version, use the command "winget install" followed by the version's ID to install it. For example, for version 3.12, run "winget install Python.Python.3.12".
This method will automatically install Python through the terminal.
Since we discussed the 2 installation methods for Python, let's now see how to run a Python program.
How to Run a Python Program
One of the most popular ways for Python developers or data scientists to run a Python program on their computer is through a widely used tool, Visual Studio Code.
To install Visual Studio Code, visit the Visual Studio Code website and click the "Download for Windows" button.
Next, open the downloaded file and click "next" in all the windows that appear until the process is completed.
Alternatively, another way to install Visual Studio Code is via winget, as mentioned earlier.
To do this, simply run the command "winget install Microsoft.VisualStudioCode" in a terminal.
Once installed, open Visual Studio Code from its shortcut and you will see the Welcome screen.
First, install the Python extension by following these steps:
1) Click on the extensions icon.
2) Click on the Python extension, which can be found under "Popular".
3) Click the "install" button on the right.
After completing the extension installation, let's create a new file by clicking on the second option "New File".
Next, select the "Python File" option as shown in the following image.
In this file, write the Python code you desire, as shown in the example below.
To execute this command, select "Run" and then "Run Without Debugging".
Finally, save your file. You can choose the file name as desired.
Finishing up, the integrated terminal has been opened within Visual Studio Code, where we can see that the command to execute the Python file has been run.
Of course, we can also see the output of what we have printed, namely "Hello, Big Blue!" and the variable a that we created.
In the same way, we can create complex programs and "run" them through Visual Studio Code.
Ramping Up
This guide for installing Python is the first fundamental step to get a basic idea of its countless possibilities.
So, if you want to explore more related topics, go ahead and follow us for more educational blogs!