Home//

How To Download and Install Python on Windows

How To Download and Install Python on Windows

Minh Vu

By Minh Vu

Updated Nov 04, 2023

Python is currently the most popular programming language in the world with millions of developers using it for tasks such as Web Development, Data Science, Machine Learning, and so on.

In this tutorial, I will guide you the first step in your Python journey: how to download and install Python on Windows.

I will keep it easy and simple for a beginner to follow. Let's get started!

Table of Contents

Follow these steps to install Python on Windows:

  1. Installing Python on Windows
  2. Verifying if Python was Installed Successfully
  3. Adding Python to the PATH Environment Variable (optional)
  4. Starting Your Python Journey
  5. Conclusion

1. Installing Python on Windows

Follow the steps below to install Python on Windows:

  1. Visit the Python download page for Windows.
  2. You can choose Latest Python 3 Release - Python 3.x.x for the latest version. I suggest you to choose Python 3.9.x or Python 3.10.x.
  3. Scroll down to the bottom and select Windows installer (64-bit) if your computer is 64-bit, or Windows installer (32-bit) otherwise.
    Download Python for Windows
    Figure: Download Python for Windows
  4. After downloading the Python installer (python-3.x.x-amd64.exe), open it to begin the installation. Remember to check those boxes and click Install Now:
    • [✓] Install launcher for all users (recommended)
    • [✓] Add Python 3.x to PATH.
      Install Python on Windows
      Figure: Install Python on Windows
  5. Wait for the installation to complete. Choose Disable path length limit if it shows up.
    Python Setup Successfully
    Figure: Python Setup Successfully
  6. Restart your computer. Then verify if Python was installed successfully in the next section.

2. Verifying if Python was Installed Successfully

Open your Command Prompt, type in python --version (or python3 --version) and press Enter.

Verifying Python Installation
Figure: Verifying Python Installation

If Python was installed successfully on Windows, the output should be the Python version like above.

In case you get one of the following errors:

  • 'python' is not recognized as an internal or external command, operable program or batch file.
  • Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

You need to add Python to the PATH environment variable. Read through the next section to know how to do it.

3. Adding Python to the PATH Environment Variable

To fix the errors mentioned above, you need to add Python to the PATH environment variable. Follow these steps:

  1. Press Windows key and search for Edit the system environment variables.
  2. Click Environment Variables.
  3. Under System variables, select Path and click Edit.
  4. Click New and add the path to the Python folder. The default path is C:\Users\{your-username}\AppData\Local\Programs\Python\Python3x (replace Python3x with your Python version). In my case, the path is C:\Users\Desmond\AppData\Local\Programs\Python\Python39.
  5. Click OK to save the changes.
  6. Restart your computer. Go back to the previous section and verify if Python was installed successfully.

4. Starting Your Python Journey

Now, you can use your command prompt to test some lines of Python code.

From your Command Prompt, type in python and press Enter, and then the interactive Python will appear on the console.

You can type in some Python code like print("Hello, World!") and press Enter to see the output.

python-windows-5
Figure: python-windows-5

FYI, most developers choose to use IDEs (Integrated Development Environments) or Text Editors such as Visual Studio Code, PyCharm, etc. Try some of them and get the most out of your coding experience.

Conclusion

To recap, in this tutorial, you have learned how to install Python on Windows in 4 easy steps:

  1. Downloading Python for Windows.
  2. Installing Python on Windows.
  3. Verifying if Python was installed successfully.
  4. Adding Python to the PATH environment variable (optional).

Good luck with your Python journey!

You can search for other posts at home page.
Minh Vu

Minh Vu

Software Engineer

Hi guys, I'm the author of WiseCode Blog. I mainly work with the Elastic Stack and build AI & Python projects. I also love writing technical articles, hope you guys have good experience reading my blog!