How to Check Python Version in Linux, Mac, & Windows
Stack How?
Stackorigin – The Community of Question and Answers Latest Articles
Read More About Python List Comprehension with examples
Python List Comprehension: Python List comprehension provides a much more short syntax for creating a new list based on the values of an existing list. Advantages of List Comprehension in Python: Time Efficient than loop Space Efficient than loop Needs ...
Do not accept an offer letter from companies.
Do not accept an offer letter from companies without verifying the following points. Designation Salary Details & CTC Distribution Leave Policies Working Hours & Days Medical Coverage/Insurance Probation Period Notice Period Benefits and Perks Bonus F&F Policy
How to call API using Ajax
AJAX stands for Asynchronous JavaScript and XML and its used for to make calls to the server to fetch some data. In this article, we will learn how to implement a simple API call using AJAX technology. How to use GET ...
This article will teach you how to check Python version in Linux, Mac, and Windows.
Step 1: Open the Terminal in Mac OS X or Linux.
Step 2: Type python –version to check Python version on Linux and Mac OS X.
Step 3: Type python -V to check Python version on Windows.
How to Check Your Python Version in a Script Using sys
learn how to check your Python version in Windows, macOS, and Linux.
How to Check Your Python Version on Windows 10
In Windows 10, we can use the PowerShell to check the version of Python that we are running. In order to access the PowerShell, simply use the following steps:
Windows + R
OK
or hitenter
Once the PowerShell is open you can access the Python version your interpreter is running by writing the commands shown below.
python --version
Python 3.8.5
python -V
Python 3.8.5
python -VV
Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ]
How to Check Your Python Version on Windows 7
On Windows 7 and earlier, you can use the command prompt to check your Python version. In order to do this, you can run the following steps:
Windows
+R
cmd
OK
or hitenter
Check the table below for the different types of commands you can run in order to check your version of Pyhton on Windows 7:
python --version
Python 3.8.5
python -V
Python 3.8.5
python -VV
Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ]
How to Check Your Python Version on macOS / Linux:
In macOS and Linux you can use the Terminal application to check your version of Python. On macOS, this can be accomplished by following the steps below:
command
+space
enter
Because some versions of macOS come with Python 2 installed by default, it’s likely that the
python
command may refer to Python 2. Because of this, you may need to runpython3
instead, to refer to that version of Python.The table below breaks down the different commands to run on macOS and Linux to get the version of Python:
python3 --version
Python 3.8.5
python3 -V
Python 3.8.5
python3 -VV
Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ]
python --version
Python 2.7.18
python -V
Python 2.7.18
How to Check Python Version in Linux
Most modern Linux distributions come with Python pre-installed.
To check the version installed, open a terminal window and entering the following:
How to Check Python Version in Windows
Most out-of-the-box Windows installations do not come with Python pre-installed. However, it is always a good idea to check.
Open Windows Powershell, and enter the following:
How to Check Python Version in MacOS
If using a MacOS, check the Python version by entering the following command in the terminal: