How to Get Python Version from Command Line using Specific Command in Microsoft Windows

Posted on

How to Get Python Version from Command Line using Specific Command in Microsoft Windows

Getting the version of an installed or an existing python available in the device is actually quite simply. Especially when the process is being done using a command line interface. Specifically when it use the Command Prompt where it is a command line interface exist in Microsoft Windows. Just type a few command in the Command Prompt, then it will show the version of the Python. So, this article will show the execution process of a certain command to get the python version.

Table of Contents

Introduction

This article will focus on how to demonstrate on getting version of Python exist in a device. That device is running using Microsoft Windows as its operating system. Using the Command Prompt which is a command line interface tool in Microsoft WIndows, it will execute several commands. Those commands will print the version of the python available or installed in the device as an output.

How to Get Python Version from Command Line using Specific Command in Microsoft Windows

Actually, there are several ways which is represented by several commands to get or to retrieve the version of existing or installed Python. Below are process of how to get the python version available or installed in the device running Microsoft WIndows as its operating system :

First of all, run the Command Prompt. In the first attempt, just run it as a normal user or using a normal user account. When the Command Prompt appear, the following display will be the appearance of the Command Prompt :

How to Get Python Version from Command Line using Specific Command in Microsoft Windows
How to Get Python Version from Command Line using Specific Command in Microsoft Windows

By running the Command Prompt, it will provide an interface for the user to be able to execute several command for retrieving output which is the version of the existing or installed Python.

Testing the Command

In order to retrieve the version of Python exist or installed, just do the following sequence of commands :

  1. As for the first one for a way to get the Python version, just type the following command :

    python

    It will then redirect the prompt for the normal prompt exist in Command Prompt to a Python command prompt. Below is the execution of the command :

    Microsoft Windows [Version 10.0.22621.2715]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\Personal>python
    Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
  2. As for the second one, just type the following command to get the version :

    python --version

    As for the execution of the command above in the Command Prompt will appear as follows :

    C:\Users\Personal>python --version
    Python 3.10.5
    
    C:\Users\Personal>
    
  3. Finally, as for the last one which is the third command is exist as follows :

    py  --version

    For the execution of that command, below is the execution display :

    C:\Users\Personal>py --version
    Python 3.10.5
    
    C:\Users\Personal>

Last but not least, for getting the information about the above command execution to get the Python version, just visit this linklink. Otherwise, try to play the video below to view the above execution steps :

Leave a Reply