How to install Python on Windows 10

Paul Hill

June 3, 2021

Python is one of the most in demand skills you can add to your resume. It’s used by Wikipedia, Google, Yahoo!, NASA, Spotify, YouTube, Instagram, DropBox and MANY more places you know of and probably visit online. The list really does just go on and on.

Python can be used as a scripting language for web applications, games, AI projects and for automating redundant tasks for IT administrators.

In this tutorial you are going to learn how you can download and install Python on Windows 10 (or any Windows OS). Let’s get started!

How to download Python

Download Python from python.org: https://www.python.org/downloads/

What version should I download?

If you are downloading Python for your own personal development then the latest version will most likely be fine. However – if you are planning to develop code for another server that also runs python you should make sure you install the same version as where the code will be executed.

Installing Python on Windows

Launch the installer file. Select Add Python 3.9 to PATH which will add python to your PATH environment variables. This will prevent commands like pip from returning errors like “pip is not recognized”.

Start the installation

Once you enable the PATH option, click Install Now and wait for the installation to complete.

Disable the Windows path length limit

The default limit for Windows paths is 260 characters. Selecting the Disable path length limit allows this limitation to be expanded to roughly 32,000 characters. This will require administrative privileges. I would recommend going ahead and enabling this if you can but if not then you will probably be fine.

Next click Close to finish the installation.

Downloading and installing Visual Studio Code

Go to https://code.visualstudio.com/download and click the download button.

Launch the installer

Accept the license agreement and choose your additional tasks. I prefer to select all of them as they make life easier.

On the next screen select the install button.

Once the installation is complete we can click Finish to launch VSCode:

Now the installation is complete.

Install the Python Extension

Open Visual Studio Code and click the Extensions tab on the left or press Ctrl+Shift+X. Next search for Python. Click the blue Install button next to the Python extensions:

Press F1 and enter “Python: Select Interpreter”, then press enter on the search result:

Visual studio code may already be able to locate your Python installation. If it does – select it now:

If Visual Studio Code does not show your python installation, you may need to specify the interpreter path (the path to python.exe) manually. Mine was located at the following path:

C:\Users\%username%\AppData\Local\Programs\Python\Python39\python.exe

Test Python configuration

Now let’s create a new file in VS Code and test our Python installation. Press Ctrl+N:

From here we can select the Python language:

Enter the following line:

print(“Hello Server Academy”)

Now let’s save the current file by pressing Ctrl+S and saving it somewhere on your computer. I am going to save it on the C drive under a folder named “python-projects”:

Now press F5 and select Python File to execute the currently opened file:

Now at the bottom of VS Code you should see a console with the output of our command:

Output:

Hello Server Academy


Now let’s open the folder we just created so we can store a debug config. Click File > Open Folder:

Now browse to the c:\python-projects folder and click open. Now you should see the helloworld.py file located in the explorer on the left:

Open the helloworld.py file – this is important for the next step when we create a launch.json file. This will allow us to configure some convenient options for running and debugging our Python code.

After you opened helloworld.py, press Ctrl+Shift+D to open the debug menu, then select create a launch.json file.

Next click Python File:

This will generate a JSON file that shows the default settings we just selected:

Now if we go back to our helloworld.py and press F5 it will debug our code immediately. Keep in mind that every time we open VS Code we should also open this folder so the json settings file will also be loaded. Finally, if desired we can also open an interactive Python terminal by simply typing python or pi in the terminal at the bottom of VS Code:

PS C:\python-projects> python

Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32

Type “help”, “copyright”, “credits” or “license” for more information.

>>> 

And that’s it! Now our python developer environment is set up and ready to go!

Blogpostctadesktop

Sign up free and start learning today!

Practice on REAL servers, learn from our video lessons, interact with the Server Academy community!

More from our blog

How to Become a Hacker

By Paul Hill | October 15, 2022

Becoming a hacker can be an exciting and rewarding six-figure job. Any product that uses digital technology is a potential target to be hacked – that means not just computers and phones but also your car, thermostats, garage door openers, smart coffee machines, and any other smart home device. That is why ethical/white hat hackers…

System Administrator Salary in 2022

By Ricardo P | August 27, 2022

Before deciding to become a System Administrator full-time, you might ask yourself, what is the system administrator salary and what can you expect? And, it is reasonable to research if becoming a System Administrator full-time will be a lucrative career. But the answer is that it all depends on your education, certifications, skills, location, and…

How to Easily Automate Tasks with PowerShell

By Ricardo P | July 1, 2022

You might know PowerShell as the improved command prompt version of Microsoft Windows, but PowerShell is more than that. It is also a scripting language that can be used for automation, and in this article we’ll show you how to automate tasks with PowerShell.

Assign License to a User using Licensing Group

By Jefferd Facundo | March 13, 2022

In this lesson, we will go through the steps on how to add user(s) to a licensing group in your Microsoft 365 tenant. Step 1: Access Microsoft Admin Center to manage the user’s license. On your browser, login to Microsoft 365 Admin Portal via https://portal.office.com On the Sign in page, enter your Global Admin username in an email…

Running Message Trace in Exchange Admin Center

By Jefferd Facundo | February 5, 2022

In this tutorial, you will learn how to run a message trace using Exchange Admin Center to track any messages that was not delivered correctly or simply getting the status of the message sent or supposed to be received by the user(s). Step 1. Log in to Exchange Admin Center for Exchange Online. On your…

How to Create a Licensing Group in Microsoft 365 Tenant

By Jefferd Facundo | February 4, 2022

In this lesson, we will go through the steps on how to Create a Licensing Group in your Microsoft 365 tenant. Step 1: Access Azure Active Directory On your browser, login to Microsoft 365 Admin Portal via https://portal.office.com On the Sign in page, enter your Global Admin username in an email format and then enter your password on…

Windows Cyber Security – STIGs for Beginners

By Paul Hill | February 1, 2022

This tutorial will show you how you can get started learning the technical side of Cyber Security for Windows environments. This tutorial is going to show you how to use STIGs (Security Technical Implementation Guides) to identify low, medium and high vulnerabilities and patch them in your Windows Environments. What is a STIG? A STIG…

Creating Mail Flow Rules

By Jefferd Facundo | January 19, 2022

In the lesson you will access the Exchange Admin Center for Exchange Online and create a mail flow rule that checks for sensitive information in emails sent from inside your organization. Step 1. Log in to Exchange Admin Center for Exchange Online. On your browser, login to Microsoft 365 Admin Portal via https://admin.microsoft.com On the…

How to run SQL Commands from PowerShell

By Paul Hill | July 23, 2021

If you want to run SQL commands from your PowerShell terminal you can do so by simply installing the SQLServer module with the command below: You will be prompted to install from an untrusted source. Type “A” to accept and install the module. Once it is complete you can see all the new commands you…

Adding Multiple Cloud Users to Microsoft 365 tenant.

By Jefferd Facundo | July 18, 2021

In this lesson, you will learn how to import multiple cloud users to your Microsoft 365 tenant. If you want to learn about getting started with Microsoft 365, click here. Step 1. Create your users’ information into CSV file using the given template in your tenant. On your browser, login to Microsoft 365 Admin Portal…