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

Love: So Beautiful but Haunting

Whatever I thought was there, she thought differently.” – Barney Stinson  ( How I met your mother ) We all want to find the love so beautiful , that the heart bleeds. When I was watching this episode (season 7, episode 17) I didn’t actually expect this quote, mainly from a guy like Barney, who is a certified sociopath, but when Barney dropped this bomb all of a sudden, it felt like a missile just ripped apart my heart and made me think. It made me ponder about one of the most complex emotions of our reality,  Love . One day, BAM! We experience that moment. It’s that moment where we see a person, and something unusual happens. For some people the time stops, some might find their hearts skipping a beat. Whatever the moment is, we all feel the same emotion, love. All of a sudden you are making future plans with that person. Plan of having a lavish vacation, or a plan of having a future family. Some of us are realists though, but even they love to think of spending time wi...

7 Best Way To Study That Will Quickly Boost Grades

Do you often feel burned out when studying? Or, do you want to make a good study habit but are failing to make one? Maybe, in this COVID situation, you are confused about how to study online, as there are presentations, PowerPoints, notes, and many more materials to cover.  Or, maybe you simply want to find  the best way to study  so that you can be as productive and  confident  as possible. If any of the above situations match with you, then this article is for you. Because it turns out that the best way of studying is not that hard. A little bit of  planning  and  time-management  is all you need to become the  next school or college batman . Here is the plan in detail: [joli-toc] TLDR Don’t just read, try to teach what you read Many students think that: The best way to study is to read the textbook only.  This is a very bad misconception because reading is not studying. What you read, you need to understand that, conceptuali...