How to get Python up and running instantly

As a beginner, getting started with Python can be a daunting task. But, my sole purpose here is to make Python Coding life easy for you.

So, in this article, I will guide you through the process of installing Python on your Windows machine, step by step. I will also cover some essential Python packages and libraries that you should consider installing. Let's get started.

download

I hope you have already gone through the previous module, where we've discussed the history, why you must absolutely know Python, its key features, top applications as well as immense career opportunities. If you haven't, do it give it a read and I assure you it will be worth your time!

Introduction to Python and its benefits

Python is a high-level, interpreted programming language that is widely used in various fields, including web development, data science, artificial intelligence, and machine learning. Python is widely popular for its simplicity, readability, and ease of use. It has a vast standard library, which makes it easy to perform complex tasks without having to write a lot of code.

python-program

One of the main benefits of Python is its portability. It can run on a wide range of platforms, including Windows, Mac, Linux, and even mobile devices. This means that you can write code on one platform and run it on another without making any significant changes.

Python is also an excellent language for beginners. Its syntax is straightforward and easy to understand, and there are plenty of resources available online such as our highly popular GUVI courses to help you learn.

All of these points and more have been discussed in detail in the previous module, so do give it a read if you want your learning journey to be thorough.

Understanding Python versions and which one to install

Before beginning the Python installation process on your Windows machine, you need to understand which version of Python to install.

Python has two major versions in use today: Python 2 and Python 3. Python 2 is an older version that is still in use but is no longer being actively developed. Python 3, on the other hand, is the current version and is the version that you should install.

Python 3 has several advantages over Python 2, including improved Unicode support, better handling of exceptions, and enhanced security features. So our pick is Python 3 and it should be yours as well.

System requirements for Python installation on Windows

Now, before installing Python, you need to ensure that your system meets the minimum requirements. Listed below are the system requirements for the installation of Python 3 on Windows:

  • Windows 7 or later
  • 1 GHz processor or faster
  • 1 GB of RAM (recommended)
  • 5 GB of free hard disk space

If your system meets these requirements, then let's get started with the installation process.

Installing Python on Windows: Step-by-step guide for beginners

To start the installation process of Python, you will need to follow a few simple steps.

Step 1: The first step involves selecting the version of Python that is most relevant to you.

This can be determined by either the operating system you are using or the project you are working on. We recommended Python 3 and that's what we'll be downloading for this demonstration.

python-download

Once you have made your choice, you can proceed to download the relevant Python Executable Installer or the 'python.exe file' from the Python.org official website.

There are multiple versions available as shown in the image below with Python 3.11.3 being the latest release. But do keep in mind that all versions after 3.9.16 are not compatible with Windows 7. So select accordingly. In this demonstration, we will be downloading Python 3.8.5.

python-release

Step 2: Download the Python Executable Installer.

You can do this by navigating to the Windows downloads section on the Python.org website and selecting the appropriate installer. In this case, we will choose the one available for Python 3.8.5.

Now navigate to the desired version ( in our case, 3.8.5) by scrolling down and selecting it like in the image below:

python-release

So click on it and your download will start automatically.

Step 3: Run the Executive Installer to Install Python

After downloading the Python Installer successfully, you need to run it by double-clicking on it. A setup wizard will be launched.

Now in the setup window, make sure to select the checkboxes to install it for 'all users' and do not forget to select the 'Add Python 3.8.5 to PATH' option because this is how your system recognizes Python.

install-python

Then, click on Install Now with the recommended settings and the installation will begin.

installing-python

Once the installation is complete, a screen confirming the successful setup of Python for Windows such as in the below image will appear.

setup-success

Step 4: Verify Python Installation on Windows

Before moving forward, you need to verify that Python is installed correctly. So open the Command Prompt by navigating to the Run window and typing 'cmd' as shown below:

run-cmd

And then type the 'python' command in the Command Prompt as follows:

command-prompt

If Python has been correctly installed and your system recognizes it, you will see the above output prompting the 'Python version' that you have installed along with its 'last update' date. The above output shows 'Python 3.11.3' as that's the latest version I have installed on my machine.

Step 5: Verify Pip Installation

This is the last step (finally) and is quite the important one. To complete the installation, you need to verify whether 'pip' has been installed or not.

Pip is Python's package management system used to install and manage software related to Python. Basically, if you want to install any Python packages, libraries, or frameworks, you need pip. It's like the internet for Google, can't really do much without it.

Now, launch the Command Prompt once again if closed and type in the command 'pip-V', and press Enter. Here, we're trying to verify whether pip exists on our machine.

check-pip-version

If you see the above output after pressing Enter, then you're absolutely welcome because you have successfully not just installed Python but also pip which means life just got a whole lot easier.

Troubleshooting common installation errors

Just in case you encounter any issues during the installation process, here are some common installation errors and their solutions:

recent-windows

  1. "Python is not recognized as an internal or external command": This error occurs when Python is not added to the PATH environment variable. To fix this, go to "Advanced system settings" -> "Environment Variables" -> "System Variables" -> "Path" -> "Edit". Then add the path to Python to the list of paths.
  2. "DLL load failed: The specified module could not be found": This error occurs when some of the required DLLs are missing. To fix this, reinstall Python and make sure to select "Add Python to PATH" during the installation process.
  3. "PermissionError: [WinError 5] Access is denied": This error occurs when you do not have sufficient permissions to install Python. To fix this, you must run the installer as administrator on your machine.

Setting up the Python environment variables

After installing Python on your Windows machine, you need to set up the Python environment variables. Now, I'm pretty sure you're brain went, wait what is that?

What are Python environment variables?

Well, they are basically used for storing the name of the environment in which your app is running. They provide a way to store and retrieve information that is relevant to the system or the application running on it.

Examples include the path to important directories or the credentials required for accessing third-party services. Environment variables are used to configure and customize the behavior of a Python application, without modifying the source code.

So basically as they operate on the Operating System-level, your source code remains safe and secure under all conditions.

Setting up your Python environment variables will allow you to use Python from any directory in the Command Prompt. Here's how to set them up:

  1. Navigate to "Advanced system settings" on your computer, then look for "Environment Variables", from the menu select "System Variables" -> "Path" -> and then click on "Edit".
  2. Add the path to the Python installation directory (where your Python installation is e.g., C:Python39) to the list of paths.
  3. Click on "OK" to save the changes and you're done.

Python IDEs - Which one to choose?

An Integrated Development Environment (IDE) is a software application that provides comprehensive facilities for Python development. Basically, it's a software application that provides a comprehensive platform for writing, debugging, and executing Python code.

It includes tools such as code editors, interactive consoles, and debugging tools. IDEs help developers write code more efficiently, manage large projects, and automate repetitive tasks. So, you're definitely going to need one.

generate-idea

We can use Python's IDLE as well of course (about which we will be discussing in the upcoming module) but it's not really feasible for developing big real-world projects. Hence, you're going to need an all-in pro IDE that assists you in any way you need. Choosing the one for you can be time-consuming but it will be a huge boon for the future of your coding career.

IDEs also provide features like code completion, syntax highlighting, and error checking, making it easier to write bug-free code. There are several Python IDEs available, and choosing the right one can be challenging.

Here are the top 3 most popular Python IDEs:

  1. PyCharm: PyCharm is a popular Python IDE developed by JetBrains. It has a wide range of features, including code completion, debugging, and version control integration.
  2. Spyder: Spyder is an open-source Python IDE that is specifically designed for scientific computing. It has a user-friendly interface and provides powerful debugging and profiling tools.
  3. Visual Studio Code: Visual Studio Code is an extremely powerful and lightweight code editor developed by Microsoft. It has a wide range of extensions available, including Python extensions, which provide features like code completion and debugging.

Try these out and I'm sure you'll find the right one for you!

Essential Python packages and libraries

Python has a vast standard library that provides a wide range of functionalities. However, there are also several third-party packages and libraries that you should consider installing. Trust me, these will make life as a coder way easier. Listed below are some of the essential Python packages and libraries:

  • NumPy: NumPy is a library in Python that is extremely useful for numerical computing. It provides support for multi-dimensional arrays and matrices, as well as a wide range of mathematical functions.
  • Pandas: The Pandas library is widely used for data manipulation as well as analysis in Python. It provides sturdy and powerful data structures, such as Series and DataFrames, as well as various tools for data preparation and cleaning.
  • Matplotlib: The Matplotlib library in Python helps us create efficient visualizations to drive business decisions and reach important conclusions. It provides support for a wide range of plot types, including line plots, scatter plots, and bar plots.

You can download them using the 'pip install' command on the command prompt. But we will dive deep into this in future modules so you don't need to worry.

Concluding Thoughts...

So now that you have successfully installed Python on your system, it's time to wet our hands with incredible Python code starting from the very basics. Stay with us throughout this amazing learning journey to master Python and inch closer to the tech career of your dreams. Happy coding!


Learn via Video Course

Python Logo

Python

6109

7 hrs