How to Check Python Version in CMD

July 04, 2023

Are you wondering how to check the Python version in CMD? Understanding the Python version installed on your system is crucial for successful programming and compatibility with various libraries and packages. In this comprehensive guide, we will walk you through the step-by-step process of checking the Python version in both Python 2 and Python 3 environments using the Command Prompt (CMD).

Step 1: Open Command Prompt (CMD)

To begin, open the Command Prompt by pressing the Windows key and typing "cmd" in the search bar. Click on the "Command Prompt" app to launch it.

Step 2: Checking Python Version in Python 2

For Python 2, enter the following command in the Command Prompt window:

python --version

Press Enter to execute the command. The installed Python version will be displayed on the screen. For instance, you might see "Python 2.7.18."

Step 3: Checking Python Version in Python 3

To check the Python version in Python 3, you have two options. Both commands yield the same result.

Option 1: Enter the following command in the Command Prompt:

python3 --version

Checking the Python version installed on your system is crucial for compatibility and effective programming.


Elevate Your Coding Skills with FreeCodeTeacher.com