You dont have javascript enabled! Please enable it! Easily Installing Python On Windows: A Guide - CHARBEL NEMNOM - MVP | MCT | CCSP | CISM - Cloud & CyberSecurity

Easily Installing Python on Windows: A Guide

7 Min. Read

In the realm of programming, Python has carved out a distinctive place due to its simplicity, versatility, and robustness. Being an industry expert, enhancing your proficiency further by incorporating Python into your skills repertoire can be a game-changer. It helps you to remain competitive in a constantly evolving technology landscape. Whether you’re just getting started or are a seasoned professional seeking to strengthen your knowledge, Python is a potent weapon to have in your arsenal.

The primary focus of this guide will be to provide a fundamental understanding of Python programming language, to clarify why it’s essential to install it on your Windows computer, and to elaborate on Python’s unique features that make it a favorite among developers.

We will also delve into the intricacies of preparing for Python installation for Windows, right from comprehending the prerequisites to checking system compatibilities. Moreover, we will guide you through the step-by-step process of installing Python on Windows and look at subsequent verification.

Understanding Python

Python is a high-level, interpreted programming language that was created by Guido van Rossum. Since its inception in the late 1980s, Python has become one of the most popular programming languages worldwide, lauded for its emphasis on readability and simplicity. Python uses a syntax that focuses on simplicity and readability, enabling developers to express concepts in fewer lines of code than might be possible in languages such as C++ or Java.

Python is incredibly versatile and can be used for a wide array of tasks, including web development, data analysis, machine learning, artificial intelligence, and more. Its great set of libraries and frameworks makes it a favorite among many developers. Python also supports multiple programming paradigms, including procedural, object-oriented, and functional programming.

Moreover, learning Python is recommended and required if you plan to study and prepare for the AI-900 (Microsoft Azure AI Fundamentals), AI-102 (Azure AI Engineer Associate), or AI-050 (Developing Generative AI Solutions with Azure OpenAI service) certification exams.

Python for Artificial Intelligence
Python for Artificial Intelligence

Installing Python on Windows

Installing Python on your Windows computer is essential for various reasons. First, Python is a popular language in the corporate world, with giants like Google, NASA, and Facebook utilizing it for their projects. Its versatility makes it an indispensable tool for any professional programmer. Secondly, Python’s robust set of libraries and frameworks make it a perfect language for tackling tasks related to data analysis, machine learning, and web development. Finally, Python’s readable and simple syntax is excellent for beginners learning to code.

Python’s syntax is intuitive and easy to learn, making it a great language for beginners. Python’s syntax often follows English language conventions, which makes the code easy to read and understand. It also aligns with mathematical ideas making it ideal for scientists or engineers.

Python offers functionalities across multiple areas, from web and software development to complex scientific calculations and graphical user interface programming. Its unique features include the use of indentation to define blocks of code instead of braces, as in many other languages. Python’s simplicity, portability, and ease of learning make it a standout choice among developers.

Installing Python on Windows
Installing Python on Windows

Python has various versions in use, with Python 2 and Python 3 being the most popular. Python 2, although deprecated as of January 2020, is still in use by many legacy systems. Python 3, the latest version, comes with many improvements and features compared to Python 2.

Python 3 is not backward compatible with Python 2. This means that programs written in Python 2 may not work in Python 3 without some modifications. However, both versions can coexist on the same system, easing the transition from Python 2 to Python 3.

When installing Python, it is crucial to ensure that your system meets the specifications required by the version you wish to install. For most general applications, Python 3 is recommended due to its improved features and continued support.

Learn: Tweet a Random Post From an RSS Feed using Python.

Preparing Python Installation for Windows

Python is compatible with a wide range of Windows operating systems. Some versions of Python are compatible with Windows 10 and newer versions, while others can operate on Windows 7 and newer versions. To ensure smooth installation and operation, it’s crucial to verify that your Windows OS supports the desired Python version.

Before starting your Python installation, make sure there’s enough memory space. For most versions of Python, the typical disk space requirement is about 25 MB, but you may need additional space for auxiliary libraries and tools. Hence, it is recommended to have around 100 MB of disk space for a complete Python installation.

Python does not require a high-end machine to work efficiently. Any computer that can run Windows will almost definitely be sufficient for running Python. However, the speed of your CPU and the amount of RAM on your computer can affect the performance of your Python programs. Therefore, it’s recommended to have a minimum of 1 GB RAM for optimal performance, though 2 GB or more would provide even better results.

To download Python, visit Python’s official website and navigate to the download section. Python offers various versions for different operating systems. Specific Python versions also align with specific Windows operating systems. For instance, if you’re running Windows 10 or Windows 11, Python 3.11.x is recommended. Always download Python’s latest stable release to avail all updated features and security patches.

Download Python for Windows
Download Python for Windows

Remember, Python provides both 32-bit, 64-bit, and ARM64 versions for Windows. Choose the one that suits your system’s architecture. If you’re unsure about your system’s architecture, right-click “My Computer” or “This PC” on your desktop or in your Start menu, select “Properties,” and look at the “System type” line to see your operating system’s architecture. You can also run the following PowerShell command to verify your system’s architecture:

Get-ComputerInfo osn*e, oso*u, osa*e
Get-ComputerInfo OS Architecture
Get-ComputerInfo OS Architecture

Before starting the installation, close all unnecessary applications. Also, remember to back up any critical information in case of unforeseen issues. Exploring Python’s official documentation for additional suggestions prior to installation can provide further insights to ensure a successful installation process. Make sure to follow all the prompts during the installation process for a seamless experience.

Installing and Verifying Python on Windows

Start off by going to the Python downloads page on their official website (www.python.org/downloads/). Here, identify the most recent stable version suitable for Windows (specifically, look for “Windows installer (64-bit)” for a 64-bit system, “Windows installer (32-bit)” for a 32-bit system, or “Windows installer (ARM64)” for an ARM64 system). Click on it and the download should commence.

Once downloaded, locate the .exe file, most likely in your downloads folder. Double-click the Python installer .exe file to start the installation procedure. An install wizard should open up. Generally, you can keep the default settings provided by this wizard.

However, make sure to check the box at the bottom that says “Add Python.exe to PATH“. This step is important as it enables you to run Python from any directory or command prompt, without specifying its exact location.

Install Python (64-bit) on Windows
Install Python (64-bit) on Windows

In the next steps, you have two installation options. If you select “Install Now“, it installs Python in a default location. If you select “Customize Installation“, you can choose different installation options and the path where Python gets installed. Generally, the “Install Now” option is fine for most purposes.

After you select your installation choice, the wizard will start installing Python and its standard libraries. It might take a few minutes. Wait until the installation process is complete, then press “Close“.

Install Python via the command line

You can also install Python on Windows via the command line or via PowerShell. Assuming that you have the python-installer.exe file you can run the following command in /passive mode in the administrator PowerShell window. You will be prompted if you run it without administrator privileges.

$installer = "C:\Users\username\Downloads\python-3.11.5-amd64.exe"
& $installer /passive InstallAllUsers=1 PrependPath=1 Include_test=0
Install Python via the command line
Install Python via the command line

Or you can use the /quiet mode in the administrator PowerShell window to install it silently:

$installer = "C:\Users\charbel.nemnom\Downloads\python-3.11.5-amd64.exe"
& $installer /quiet InstallAllUsers=1 PrependPath=1 Include_test=0

To verify that Python was successfully installed, open your Command Prompt (Press Windows Key+R, type “cmd” and hit Enter). In the command prompt, simply type “python --version” and press Enter. If Python was installed correctly, you should see something similar to “Python 3.11.x” (with the ‘x’ being the release level or specific version). This confirms that Python is installed and operational.

Verify Python installation
Verify Python installation

At the time of writing, Python version 3.12 is planned to be released on 02-10-2023.

Troubleshooting Python Installation

If typing “python” on your command line didn’t work, it’s possible Python didn’t install properly or isn’t on your PATH. Try reinstalling Python and ensuring you checked “Add Python to PATH“.

If you’re still encountering issues, you might need to manually add Python to your Windows Path. Open your System Properties (Press Windows Key+R, type “systempropertiesadvanced” and hit Enter).

Troubleshoot & Verify Python installation on Windows
Troubleshoot & Verify Python installation on Windows

In the system properties window, simply click on Environment Variables… then select Path and click Edit… under user variables for your user, and make sure that the Python path is added as follows (C:\Users\username\AppData\Local\Programs\Python\Python311).

Add Python to Windows Path
Add Python to Windows Path

You can also set “Python Location” to the path by running the following PowerShell command:

# Set Python location
setx /M path "%path%;C:\Program Files\Python311"
$env:PATH =$env:PATH+";C:\Program Files\Python311"

Update Python to the latest version on Windows

To upgrade to a newer version, just as you did when initially installing Python as described earlier, open the official Python Releases for Windows page, select the latest Python release, download, and run the suitable installer.

If the latest release is just a new Python patch of the same major version as your current version (e.g., 3.11.4 and 3.11.5), you need to select the “Upgrade Now” option in the wizard as shown in the pop-up window below.

Update Python to the latest version on Windows
Update Python to the latest version on Windows

In this case, the latest Python version will be installed on your computer, and the previous version will be removed. You might need to restart your machine afterward.

If the latest release is a new major version of Python with respect to your current version (e.g., 3.11 and 3.12), you will see the same initial installation option “Install Now” as shown in the pop-up window below.

Install a new major version of Python
Install a new major version of Python

In this case, the latest Python release will be installed on your computer but also the previous version will remain. Do note that you should uninstall previous versions of Python before installing a new version. Having two versions can create conflicts, and Windows might not know which one to use.

To uninstall a previous version, go to Control Panel → Programs → Programs and Features, select the Python version you want to uninstall and click on uninstall.

That’s it there you have it!

Conclusion

With the information provided, you should now be equipped with a clear insight into Python, its background, uses, and features. Additionally, you possess the knowledge to prepare your Windows computer for Python installation meticulously, ensuring that all prerequisites are duly catered to. More importantly, you have learned the practical aspect of installing Python and verifying it on your Windows computer, making you more than ready to explore the vast universe that Python opens up for you.

But beyond the technicalities and procedures, what’s most crucial is the motivation to keep learning, developing, and building with Python. Make Python more than just a new installation on your computer; make it valuable in your professional toolkit. Now you have all the necessary tools and settings to start working in Python.

__
Thank you for reading my blog.

If you have any questions or feedback, please leave a comment.

-Charbel Nemnom-

Photo of author
About the Author:
Charbel Nemnom
Charbel Nemnom is a Senior Cloud Architect with 21+ years of IT experience. As a Swiss Certified Information Security Manager (ISM), CCSP, CISM, Microsoft MVP, and MCT, he excels in optimizing mission-critical enterprise systems. His extensive practical knowledge spans complex system design, network architecture, business continuity, and cloud security, establishing him as an authoritative and trustworthy expert in the field. Charbel frequently writes about Cloud, Cybersecurity, and IT Certifications.
Previous

Managing Microsoft Defender for Identity – Comprehensive Guide

Mastering Cybersecurity: Insights on Certification – Comprehensive Guide

Next

Let us know what you think, or ask a question...