Skip to main content

How to Install Python on windows and Write Your First Python Program

install python windows feature picture

Whether you want to create an awesome website or to build the next matrix-like AI, you need to know to program. If you are a beginner in the programming world, then programming tutorials even for beginners might seem daunting. But, Python will be an excellent starting way for your programming journey or to build your dreams from “nothing”. In this Python Programming Tutorial series, I am going to introduce you to the beautiful world of programming and python and in this article, I’ll show you how to install and write your first python program on any version of windows.

[joli-toc]

What is Python?

Python is basically one of the most popular and used programming languages in today’s world.

Suppose, you are feeling hungry. You may express it in many ways. You can non verbally convey it by crying or catching attention. To verbally express it, you may use any 6,500 current languages in this world.
In English, it sounds: I am Hungry
In Bangla, it is said as: আমি ক্ষুধার্ত
In Japanese, they say: お腹が空きました (Onaka ga akimashita)

The point is, no matter how you express it, in the end, it will showcase the same meaning which is your need to eat.

In the same way, to communicate with our computer and do something wonderful with it, we need to use programming languages. Every language has its own grammar, syntax, and usage.

install-python-windows-tutorial-a burrito picture
some food for you

Why this name?

When I started watching various Python tutorials, I wondered about the reason behind the name of Python Language. To be honest, whenever I hear the word “Python”, my monkey brain automatically creates a huge python snake image and makes me a bit nervous.

Well, turns out that, the creator of the Python language, Guido van Rossum used to read the published scripts from “Monty Python’s Flying Circus”. He wanted to give his programming language a short, unique, and slightly mysterious name. So inspired by Monty Python he gave his language name Python.

install python on windows picture 2: Guido van Rossum the creator of python
guido@python.org

How to Install Python on Windows 10/8.1/8/7

Okay, enough of the chit-chat. Let’s start the fun part. In this Python Programming Tutorial, we will learn to install and run our very first program in python.
You can directly install python or install Anaconda(which will take care of it)
By installing Anaconda you have to face less hassle and can install many important packages with one click.
If you are using a Linux Operating System, chances are you already have python preinstalled.

In this python tutorial article, we will talk about how to install python on windows 10/8.1/8/7. But the procedure is more or less the same for other operating systems.

How to install Python on Windows(Step By Step Guide)

  1. Go to https://www.python.org/downloads/

    Here you will find a “Download” button. It will download the latest version of Python. The latest version is 3.9.2 right now(2nd April 2021).install python on windows python download page

  2. (Optional) Choose another Python version

    If you scroll down you will find older/different versions of Python. Remember, Python 2.X.X is very different than any python 3.X.X version. So, choose carefully.install python on windows 2nd step

  3. Choose x86-64 executable or zip file format in order to install Python

    If you click download for the latest version, your download will automatically start. If you choose another Python version, another page will open like this. Scroll down and you will find a section named “Files”, choose x86-64 executable or zip file if you have a 64-bit machine. Choose the x86 version only if you have a 32-bit machine. (Note: you cannot run a 64 variant of python in your 32-bit machine. So, choose carefully. if you choose zip, you have to extract it with any compression software like WinRAR. I personally prefer the EXE version, because I am lazy!)
    install python on windows 3rd step

  4. Run the Python launcher. Check “Add Python 3.XX/2.XX to path”.

    After finishing the download, run the downloaded python launcher. Check “Add Python 3.XX/2.X.X to path” NOTE: If you uncheck it, then you have to manually configure the environmental variable. Yeah! So, check it.
    install python on windows step 4

  5. Click on “Install Now” to install it to the default location.

    Or you can also click on “Customize installation” to install python to your desired location. But do that, only if you know what you are doing. To avoid facing any unnecessary hassle, install Python to the default location.
    install python on window tutorial: install on default location button

  6. Run Command Prompt to make sure Python has installed well.

    To check if python is installed, press “Windows Key + R”, write “cmd” and run. The command prompt will be opened. Now enter “Python –version” without any quotation marks. If everything works fine, you will find something like this.
    (Note: Just because I have already installed Python 3.6.6 on my machine, it is showing this version. In your machine, it will show the version you installed)install python windows last step, showing command prompt

Common Problems Faced to install Python on windows

I can’t see the python version in the command prompt.

Ans: You might’ve missed checking the “Add Python 3.XX to Path” option during the installation. So, now either you need to add the environment variable all by yourself or go to the folder where you have installed python. Press the Windows key(beside the left Ctrl key) and ‘R’ keys together. A new command prompt window will appear. Now check your python version as mentioned above.

Python setup failed error: “0x80070005 access denied.”

Ans: Right-click the Python Installer file. Select “Run as administrator”. Now install python normally.

Python setup failed error: “0x80070642 – User canceled installation”

Ans: Uncheck the “Install launcher for all users” option when you are installing python. Once unchecked, the installer should work as expected.

I can’t find any python version on the Python download page.

Ans: Check your internet connection.

Our First Python Programming

Creating Our Work Folder

Let’s write our first python program, shall we?

Let’s make a folder named “My Python Apps”. You can make this folder anywhere you want. After that press the “windows” button and write “IDLE” and run it. This is the official python shell*. You can directly run codes from here.

Our First Python Program

Let’s print something. To print something we have to literally just type “print()”  with no quotation marks. Inside there write anything you want but now with the Quotation Marks!

The reason is print is a function and the writing we are putting inside the bracket is a string that has to be declared within the quotation marks. Don’t worry, if this sounds a bit complicated, we will talk about it in detail later.

For now, let’s type exactly as follow:

print("Hello, world!")

Now after pressing enter, you will have something like this:

install python on windows picture 3: Printing "Hello World" on shell

Congratulation! You just created your first program. Let’s now experiment with it. Let’s try putting our name in there. Instead of typing “Hello World”, let’s put “My name is” and your name. Press Enter. You should have something like this:

install python on windows picture 4: Printing "my name" on python shell

You can also try to and experiment with other things in the print. Try to see what works and whatnot. If something won’t work, something like this might occur:

install python on windows picture 5: getting an error

Don’t worry, it’s just an error that basically tells you what is not working. We will discuss errors more deeply in the later python tutorial articles.

Conclusion

That’s the end of the first article of this Python Programming Tutorial series. I hope you enjoyed it. In the future, we will further talk about more complex topics like functions, OOP, and others.


  •  Shell: In a simple term, a shell is a user interface that takes command as input, from the user and executes the command.

References

Some very useful python learning websites (in my opinion)

Some very useful python learning YouTube channels (in my opinion)

Comments

  1. You are sharing a piece of nice information here. The information you have provided is genuinely instructive and significant for us. Thanks for sharing an article like this.Learn Python Programming Online

    ReplyDelete

Post a Comment

Popular posts from this blog

In The World of Fake Friends(Problem Or Not?)

Nowadays when I surf social media I get a lot of statuses about fake friends. My wall gets rumbled by cheesy fake friends quotes. It seems like everyone is becoming selfish, how “real love” or “real friendship” is becoming so rare and most importantly how ‘fake friends’ are becoming our only friends. Now, for me, friendship is a relationship where there is a minimal amount of selfishness is involved. We see friends who celebrate fifty years of friendship. We see friends who sacrifice themselves for their friends. But still, it seems like in our own lives, we don’t get the same treatment from our friends that we see in other’s lives. We begin to get bitter about our friends, we begin to complain about how life is so unfair and we only have fake friends. So, what’s the issue here? Me And My Bois Judging Other Table of Contents Life happens Jealousy Miscommunication In the end only a few matters Life happens This is the most important, simplest, and rather boring rea...

The Rudest Book Ever: Learn How to think

Shwetabh Gangwar is one of those rare YouTubers whom I gladly found. His “ The Rudest Book Ever ” is a simple yet intellectually challenging book that might even make you severely uncomfortable. In this article, we are going to talk about “The Rudest Book Ever”. Do you love to think? Do you love to share different perspectives with people? Are you fed up with those so-called “Motivational” speakers, who talk all rainbow and unicorn but when it comes to applying, those talk sucks? Then Shwetabh Gangwar’s “The Rudest Book Ever” is for you. In late 2018, while mindlessly surfacing the web, I came to know about Shwetabh Gangwar. An Indian YouTuber with a rude mouth, I felt very uncomfortable watching his videos first. But then, I came to realize that everything this guy is saying is true. Pure, no bullshit truth. And I was hooked. He didn’t (and still don’t) care about what other people thought about his perspectives, he refused to take media/public narratives without any lo...