Tuesday, May 14, 2024
HomeSoftwareHow to Check Python Version in cmd

How to Check Python Version in cmd

How to Check Python Version

First, open a command prompt and change to the directory where you installed Python.

Next, enter the following command:

python -V
This will return the version of Python that is currently installed on your system.

How to Check Python Version in cmd

To check the Python version in Windows Command Prompt:

1. Open a command prompt and type “python” without the quotes. Python will launch, showing you its version number.
2. If you’re running on a different flavor of Windows, or if you have an earlier Python version installed, this won’t work! In that case, install the latest stable release of Python from https://www.python.org/downloads/. Once it’s installed, try again and this time enter “python -V”.

How to Display Python Version in Console

First, open the command prompt and type python. If you are using Windows, you may need to install the Python software.
Next, use the dir command to list all of the files in your current directory. The output should look something like this:

C:\Users\username>dir

C:\Users\username>

If the version of Python that is installed on your computer is 3 or later, you will see a file named “python3” in the directory. If there is no such file, then your computer has a newer version of Python and you will need to install that version before continuing.
Next, open a new tab in your command prompt and change directories (using cd) to where you want to install Python. For example:

C:\Python34>cd C:\Python34

How to Check Python Version in PowerShell

How to Check Python Version in PowerShell
There are two ways you can check the Python version installed on your machine. The first way is to use the Get-PythonVersion cmdlet:

1. Open a PowerShell prompt and type:

Get-PythonVersion

2. You’ll get a response like this:

3. Look for the version number, which will be something like “3.5”. If you’re using an older version of Python, it might be “2.7”.
The second way to check your Python version is to use the pythonversion command line tool:

1. Open a terminal window and type:
pythonversion
You’ll get a response like this (assuming you have Python 3 installed):

Conclusion

In this article, we will show you how to check Python version in command prompt. To do so, open the command prompt and type python –version. If you are using Windows, you can also use the following code: python -V

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments