How to test Python on Windows 11 to make sure that it installs correctly

Posted in:

How to test Python on Windows 11 to make sure that it installs correctly

There are a couple of ways to test Python on Windows 11 and make sure to check if Python is properly configured on your system:

  1. Using Windows Terminal: Open a new Terminal window on your computer, type python. If Python is properly installed, you should see the version number and a prompt to enter a command.
  2. Running a Simple Script: Create a new text file and name it “test.py” and add the following line of code:

The first thing you should do after installation is to test Python on Windows 11 to ensure that it is working correctly. There are a couple of ways to do this that this guide will show you.

Test Python on Windows 11 via Terminal

You can test Python on Windows 11 by opening a new Terminal (PowerShell or Command Prompt) window and typing python and pressing Enter. If Python is properly installed, you should see the version number and a prompt to enter a command. This means that Python is installed and working correctly on your system.

test python on windows 11

Test Python using a simple script

Another way to test your python installation is by running a simple script. Open Notepad on Windows 11, create a new text file, name it “test.py” and add the following line of code:

print("Hello, Python!")

How to test Python on Windows 11 to make sure that it installs correctly - OnMSFT.com - January 16, 2023

Save the file and then go back to the Terminal window from the first step and navigate to the directory where the file is saved. Once you are in the correct directory, type python test.py and press Enter. If everything is working correctly, you should see the message “Hello, Python!” printed in the Terminal.

test python on windows 11

Additionally, you can also test specific modules or packages by installing them using pip and importing them in a script or shell. pip is a package management system for Python that installs different software packages to your machine.

Check the Python Package Index to browse packages you can use. Type pip install <package_name> and press Enter, and pip will install the package. Once it is installed, you can test it by importing it in a script or the Python shell and using the functionality provided by the package.

Once you confirmed that Python is installed and working correctly, you can start learning more about Python by going through the tutorials and documentation available online.

< Previous

Efficiently download and install Python on Windows 11

Everything new in Microsoft Viva Goals in 2023: Health Insights feature & more

Next >