To check your Python version, run python ββversion
in your command line (Windows), shell (Mac), or terminal (Linux/Ubuntu). To check your Python version in your script, run import sys
to get the module and use sys.version
to find detailed version information in your code.
![Check Python Version [Win/Linux/MacOS] Infographic](https://blog.finxter.com/wp-content/uploads/2020/12/pythonVersion-1024x576.jpg)
Let’s get a quick overview of the different ways to check your Python version in all operating systems and environments. This may be all you need to know:
Commands | Where? | What? | Example Output |
---|---|---|---|
python ββversion orpython -V orpython -VV | Terminal | Mac/Linux/Win | Python 3.7.2 |
import sys | Python Script | Information string | '3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]' |
sys.version_info | Python script | Version info tuple | sys.version_info(major=3, minor=7, micro=2, releaselevel='final', serial=0) |
import platform platform.python_version() | Python script | Short string info | '3.7.2' |
platform.python_version_tuple() | Python script | Short tuple info | ('3', '7', '2') |
In the following screenshot, you can see how I checked the Python version in my Windows PowerShell:

Do you want to develop the skills of a well-rounded Python professional—while getting paid in the process? Become a Python freelancer and order your book Leaving the Rat Race with Python on Amazon (Kindle/Print)!
Overview
When Guido van Rossum released the first viable Python version 0.9.0 in 1991, he couldn’t have expected (by a long shot) that he was on the verge of creating the most influential programming language in the world. Python has a bright future: every new Python version adds new features to the programming language.
In the following video and blog tutorial, I’ll show you how to check your Python version—no matter your operating system (Windows, macOS, Linux, Ubuntu) and programming framework (Jupyter).
You can play the video while you scroll down to read the step-by-step instructions on how to check your Python version.
If you’re like me ten years ago, you need to Google important Python commands again and again. Fortunately, I found a simple and effective (and free) way to improve my Python skills.
And so can you: learning with cheat sheets.
Join my email academy and download your free Python cheat sheets about various topics such as keywords, object-orientation, NumPy, and data structures.
Download your FREE Python cheat sheets and print them to your office wall (link to my email academy signup page on this blog)!
Environments
This general method works across all major operating systems (Windows, Linux, and macOS).
OS & Environment | Method |
---|---|
Win10, Win7 | Open command line and run python -V or python ββversion |
MacOS, Linux, Ubuntu | Open terminal and run python -V or python ββversion |
Python Shell, Juypter Notebook | Interactive mode:>>> import sys |
Python Editor, Juypter Notebook | Normal mode:import sys |
The table shows you how different environments call for different commands to check your Python version.
You may have the following question:
How to open your command line or terminal?
- Windows: Hit shortcut
Win+R
, typepowershell
, hitOK
. - MacOS: Hit shortcut
Cmd+Space
, typeterminal
, hitOK
. - Linux: Hit shortcut
Ctrl+Alt+T
.
The Python version output consists of three numbers major:minor:micro. For example, version 3.7.2 means that
- the major version is 3,
- the minor version is 7, and
- the micro version is 2.
[ATTENTION] Different major versions are NOT fully compatible. Different minor versions are compatible.
For example, you can execute code written in Python 3.6.4 in Python 3.7.2 because they are the same major version — Python 3. But you cannot execute code written in Python 2.7.4 in Python 3.7.2 because they are different major versions.
π‘ Note: new minor versions can add changes to the language. For example, in Python 3.8 they introduced the reversed()
function with dictionaries. You cannot use the reversed()
function in older versions of Python. But the vast majority of the language is the same.
Let’s dive into the exact steps to check your Python version in any environment.
I tried to figure out any environment you may be interested in. But if you don’t find yours, please let me know and I’ll add your specific environment, too.
Check Which Python Version in Script (Exact Steps)
Sometimes, you want to check Python’s version in your Python program.

To achieve this, simply import the sys
module and print the sys.version
attribute to your Python shell:
>>> import sys >>> print(sys.version) 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]
Check Python Version Jupyter (Exact Steps)
Three steps to check the Python version in a Jupyter notebook.
- Open the Jupyter notebook: type
in your terminal/console.jupyter notebook - Write the following Python code snippet in a code cell:
from platform import python_version print(python_version())
3. Execute the script.
As an alternative, you can also use the following Python code snippet to check your Python version in a Jupyter notebook:
>>> import sys >>> sys.version
Here is a screenshot on my computer:
Check Python Version Windows 10 (Exact Steps)
Three steps to check the Python version on your Win 10 operating system:
- Open the Powershell application: Press the Windows key to open the start screen. In the search box, type βpowershellβ. Press enter.
- Execute
command : typepython ββversion
and press enter. - The Python version appears in the next line below your command.
Check Python Version Windows 7 (Exact Steps)
Three steps to check the Python version on your Win 7 operating system.
- Open the command prompt application: Press the Windows key to open the start screen. In the search box type β
command
β. Click on the command prompt application. - Execute
command : typepython ββversion
and pressEnter
. - The Python version appears in the next line right below your command.
Check Python Version Mac (Exact Steps)
Four steps to check the Python version on your Mac operating system.
- Press
CMD
+Space
to open Spotlight. - Type β
terminal
β and press enter. - Execute
command : typepython ββversion
orpython -V
and pressEnter
. - The Python version appears in the next line below your command.
Check Python Version Linux (Exact Steps)
Three steps to check the Python version on your Linux operating system.
- Open the terminal application (for example, bash).
- Execute
command : type inpython ββversion
orpython -V
and pressEnter
. - The Python version appears in the next line below your command.
Check Python Version Ubuntu (Exact Steps)
Four steps to check the Python version on your Ubuntu operating system.
- Open Dash: click the upper left symbol.
- Open terminal: type “
terminal
“, click on the terminal app. - Execute
command : typepython ββversion
orpython -V
and pressEnter
. - The Python version appears in the next line right below your command.
Do you need to google important Python keywords again and again?
Simply download this popular Python cheat sheet, print the high-resolution PDF, and pin it to your office wall:
Check Your Python Version in Anaconda (Exact Steps)
You can choose from different alternatives.
- To check your Anaconda version, run
conda -V
orconda --version
in your anaconda prompt. You can open the anaconda prompt by searching for “anaconda prompt
” in your OS’s search field. - An alternative to get your Anaconda version is to run
conda list anaconda
. - The shorter command
conda list
lists the name, version, and build details of your installed packages. - To learn about your environment details, run
conda info
with the optional flagββenvs
to see all your environments. - To check your Python version, run
python -V
orpython ββversion
in your terminal.
Related Material: Please find more detailed information about setting up your environment here. You can download an informative Anaconda cheat sheet here.
Check Your Python Version in Spyder (Exact Steps)
In your Spyder code editor, it’s even simpler to check your Python version.
Just run any script and the version information will appear in the first line before the output of your script.
[History] What are the Different Python Versions?
Python has three main versions: version 1, version 2, and version 3. Version 4 is currently (2020) under development.
Here is the version history from Wikipedia and the official docs.
Python 3.0 – December 3, 2008
- Python 3.8.2 β released on 24 February 2020.
- Python 3.8.1 β released on 18 December 2019.
- Python 3.8.0 β released on 14 October 2019.
- Python 3.7.7 β released on 10 March 2020.
- Python 3.7.6 β released on 18 December 2019.
- Python 3.7.5 β released on 15 October 2019.
- Python 3.7.4 β released on 08 July 2019.
- Python 3.7.3 β released on 25 March 2019.
- Python 3.7.2 β released on 24 December 2018.
- Python 3.7.1 β released on 20 October 2018.
- Python 3.7.0 β released on 27 June 2018.
- Python 3.6.10 β released on 18 December 2019.
- Python 3.6.9 β released on 02 July 2019.
- Python 3.6.8 β released on 24 December 2018.
- Python 3.6.7 β released on 20 October 2018.
- Python 3.6.6 β released on 27 June 2018.
- Python 3.6.5 β released on 28 March 2018.
- Python 3.6.4 β released on 19 December 2017.
- Python 3.6.3 β released on 03 October 2017.
- Python 3.6.2 β released on 17 July 2017.
- Python 3.6.1 β released on 21 March 2017.
- Python 3.6.0 β released on 23 December 2016.
- Python 3.5.8 β released on 29 October 2019.
- Python 3.5.7 β released on 18 March 2019.
- Python 3.5.6 β released on 8 August 2018.
- Python 3.5.5 β released on 4 February 2018.
- Python 3.5.4 β released on 25 July 2017.
- Python 3.5.3 β released on 17 January 2017.
- Python 3.5.2 β released on 27 June 2016.
- Python 3.5.1 β released on 07 December 2015.
- Python 3.5.0 β released on 13 September 2015.
- Python 3.4.10 β released on 18 March 2019.
- Python 3.4.9 β released on 8 August 2018.
- Python 3.4.8 β released on 4 February 2018.
- Python 3.4.7 β released on 25 July 2017.
- Python 3.4.6 β released on 17 January 2017.
- Python 3.4.5 β released on 26 June 2016.
- Python 3.4.4 β released on 06 December 2015.
- Python 3.4.3 β released on 25 February 2015.
- Python 3.4.2 β released on 4 October 2014.
- Python 3.4.1 β released on 18 May 2014.
- Python 3.4.0 β released on 16 March 2014.
- Python 3.3.7 β released on 19 September 2017.
- Python 3.3.6 β released on 12 October 2014.
- Python 3.3.5 β released on 9 March 2014.
- Python 3.3.4 β released on 9 February 2014.
- Python 3.3.3 β released on 17 November 2013.
- Python 3.3.2 β released on 15 May 2013.
- Python 3.3.1 β released on 7 April 2013.
- Python 3.3.0 β released on 29 September 2012.
- Python 3.2.6 β released on 11 October 2014.
- Python 3.2.5 β released on 15 May 2013.
- Python 3.2.4 β released on 7 April 2013.
- Python 3.2.3 β released on 10 April 2012.
- Python 3.2.2 β released on 4 September 2011.
- Python 3.2.1 β released on 10 July 2011.
- Python 3.2 β released on 20 February 2011.
- Python 3.1.5 β released on 9 April 2012.
- Python 3.1.4 β released on 11 June 2011.
- Python 3.1.3 β released on 27 November 2010.
- Python 3.1.2 β released on 21 March 2010.
- Python 3.1.1 β released on 17 August 2009.
- Python 3.1 β released on 27 June 2009.
- Python 3.0.1 β released on 13 February 2009.
- Python 3.0 β released on 3 December 2008.
Python 2.0 – October 16, 2000
- Python 2.7.17 β released on 19 October 2019
- Python 2.7.16 β released on 02 March 2019
- Python 2.7.15 β released on 30 April 2018
- Python 2.7.14 β released on 16 September 2017
- Python 2.7.13 β released on 17 December 2016
- Python 2.7.12 β released on 26 June 2016.
- Python 2.7.11 β released on 5 December 2015.
- Python 2.7.10 β released on 23 May 2015.
- Python 2.7.9 β released on 10 December 2014.
- Python 2.7.8 β released on 1 July 2014.
- Python 2.7.7 β released on 31 May 2014.
- Python 2.7.6 β released on 10 November 2013.
- Python 2.7.5 β released on 15 May 2013.
- Python 2.7.4 β released on 6 April 2013.
- Python 2.7.3 β released on 9 April 2012.
- Python 2.7.2 β released on 11 June 2011.
- Python 2.7.1 β released on 27 November 2010.
- Python 2.7 β released on 4 July 2010.
- Python 2.6.9 β released on 29 October 2013.
- Python 2.6.8 β released on 10 April 2012.
- Python 2.6.7 β released on 3 June 2011.
- Python 2.6.6 β released on 24 August 2010.
- Python 2.6.5 β released on 19 March 2010.
- Python 2.6.4 β released on 25 October 2009.
- Python 2.6.3 β released on 2 October 2009.
- Python 2.6.2 β released on 14 April 2009.
- Python 2.6.1 β released on 4 December 2008.
- Python 2.6 β released on 1 October 2008.
- Python 2.5.4 β released on 23 December 2008.
- Python 2.5.3 β released on 19 December 2008.
- Python 2.5.2 β released on 21 February 2008.
- Python 2.5.1 β released on 18 April 2007.
- Python 2.5 β released on 19 September 2006.
- Python 2.4.4 β released on 18 October 2006.
- Python 2.4.3 β released on 29 March 2006.
- Python 2.4.2 β released on 28 September 2005.
- Python 2.4.1 β released on 30 March 2005.
- Python 2.4 β released on 30 November 2004.
- Python 2.3.5 β released on 8 February 2005.
- Python 2.3.4 β released on 27 May 2004.
- Python 2.3.3 β released on 19 December 2003.
- Python 2.3.2 β released on 3 October 2003.
- Python 2.3.1 β released on 23 September 2003.
- Python 2.3 β released on 29 July 2003.
- Python 2.2.3 β released on 30 May 2003.
- Python 2.2.2 β released on 14 October 2002.
- Python 2.2.1 β released on 10 April 2002.
- Python 2.2p1 β released on 29 March 2002.
- Python 2.2 β released on 21 December 2001.
- Python 2.1.3 β released on 8 April 2002.
- Python 2.1.2 β released on 16 January 2002.
- Python 2.1.1 β released on 20 July 2001.
- Python 2.1 β released on 15 April 2001.
- Python 2.0.1 β released on 22 June 2001.
- Python 2.0 β released on 16 October 2000.
Python 1.0 – January 1994
- Python 1.6 β released on 5 September 2000.
- Python 1.5.2p2 β released on 22 March 2000.
- Python 1.5.2p1 β released on 6 July 1999.
- Python 1.5.2 β released on 30 April 1999.
- Python 1.5.1p1 β released on 6 August 1998.
- Python 1.5.1 β released on 14 April 1998.
- Python 1.5 β released on 17 February 1998.
- Python 1.4 β released on 25 October 1996.
Python 0.9.0 – February 20, 1991
- Python 0.9.1 β released on February 1991
- Python 0.9.2 β released in Autumn, 1991
- Python 0.9.4 β released on December 24, 1991
- Python 0.9.5 β released on January 2, 1992
- Python 0.9.6 β released on April 6, 1992
- Python 0.9.8 β released on January 9, 1993
- Python 0.9.9 β released on July 29, 1993
As there are some significant differences in syntax, you should always install the latest version in Python. Keep yourself updated on the official Python website here.
π Recommended Tutorial: How to Update Python?
How to Upgrade to a Newer Version?
If you are not using a virtual environment, go to python.org/downloads to download and install whatever version you need. It’s the easiest way to upgrade Python.
But now youβll run into the following problem: how do I run a specific Python version? Check out this StackOverflow answer to learn the exact steps.
Or you can make your life easier by using virtual environments.
These let you have multiple versions of Python installed on your system. Plus, you can switch between them instantaneously.
One option is to use the built-in module venv
. If you’re a Data Scientist, the industry standard is Anaconda.
Installing and upgrading different Python versions is easy when you use virtual environments. For a full tutorial of virtual environments, read over our introductory Finxter blog article.
How to Check if Python 3 is Installed?
If you’ve installed multiple installations of Python, running python ββversion
may give you only the version of Python 2.
To check which version of Python 3 is installed on your computer, simply run the command python3 ββversion
instead of python --version
.
How to Check Python Version – Detailed
Not only does Python have major, minor and micro versions. Each of those versions has further versions, namely the release level and serial.
These are displayed when you run
>>> import sys >>> sys.version_info sys.version_info(major=3, minor=8, micro=0, releaselevel='final', serial=0)
In the above code, I am running Python 3.8.0.
Most of the time, you will only care about the major, minor and micro releases. Release level and serial are usually for the core Python developer team to work on changes to the language.
The possible release levels are βalpha
β, βbeta
β, βcandidate
β, or βfinal
β.
- Alpha contains the first updates made to the language.
- Beta means the language can be tested with some users but still wonβt work perfectly. This is where the phrase βbeta testersβ comes from.
- Candidate has only a few small bugs left to fix.
- Final is the last version and the one released to the general public.
If you want to try out new features before anyone else, you can download these release levels.
However, if you just want a version of Python that works, you should choose βfinal
β. When you download any version of Python, it will be a βfinal
β release unless stated otherwise.
Serial is for the smallest changes. The Python-Dev team increments it as they make changes to the alpha, beta and candidate versions.
All final versions have serial=0
. They add future changes to the next major/minor/micro releases.
How to Make Sure My Script Runs a Specific Python Version?
Letβs say youβve just installed Python 3.8.
Your script, my_file.py
, uses a brand new feature: reversed()
when iterating over a dictionary.
For other people to run this script, they must also run Python 3.8. So you should put a check at the start to let other users know this.
We do this by adding an assert
statement at the top of my_file.py
# my_file.py import sys assert sys.version_info >= (3, 8) my_dict = dict(a=1, b=2, c=3) for key in reversed(my_dict): print(key)
The assert
statement raises an AssertionError
if the statement is False
. If the statement is True
, the script continues to run.
For example, if I am running Python 3.7 and execute my_file.py
from the terminal, this happens:
# Running Python 3.7 $ python my_file.py Traceback (most recent call last): File "my_file.py", line 10, in <module> assert sys.version_info >= (3,8) AssertionError
But if I am running Python 3.8, the assert
statement does not raise an error, and it executes the rest of the script.
# Running Python 3.8 $ python my_file.py c b a
Note: I have used the Anaconda virtual environment to install and quickly switch between multiple Python versions.
Summary
Check the Python version by typing python ββversion
in your operating system shell or command line.
To get more detailed information about the environment your Python program runs in, try import sys; sys.version
in your Python shell (interactive or normal mode).

Programmer Humor
Q: What is the object-oriented way to become wealthy?
π°
A: Inheritance.
Where to Go From Here?
Enough theory. Letβs get some practice!
Coders get paid six figures and more because they can solve problems more effectively using machine intelligence and automation.
To become more successful in coding, solve more real problems for real people. Thatβs how you polish the skills you really need in practice. After all, whatβs the use of learning theory that nobody ever needs?
You build high-value coding skills by working on practical coding projects!
Do you want to stop learning with toy projects and focus on practical code projects that earn you money and solve real problems for people?
π If your answer is YES!, consider becoming a Python freelance developer! Itβs the best way of approaching the task of improving your Python skillsβeven if you are a complete beginner.
If you just want to learn about the freelancing opportunity, feel free to watch my free webinar βHow to Build Your High-Income Skill Pythonβ and learn how I grew my coding business online and how you can, tooβfrom the comfort of your own home.
More Finxter Tutorials
Learning is a continuous process and you’d be wise to never stop learning and improving throughout your life. π
What to learn? Your subconsciousness often knows better than your conscious mind what skills you need to reach the next level of success.
I recommend you read at least one tutorial per day (only 5 minutes per tutorial is enough) to make sure you never stop learning!
π‘ If you want to make sure you don’t forget your habit, feel free to join our free email academy for weekly fresh tutorials and learning reminders in your INBOX.
Also, skim the following list of tutorials and open 3 interesting ones in a new browser tab to start your new — or continue with your existing — learning habit today! π
Python Basics:
- Python One Line For Loop
- Import Modules From Another Folder
- Determine Type of Python Object
- Convert String List to Int List
- Convert Int List to String List
- Convert String List to Float List
- Convert List to NumPy Array
- Append Data to JSON File
- Filter List Python
- Nested List
Python Dependency Management:
- Install PIP
- How to Check Your Python Version
- Check Pandas Version in Script
- Check Python Version Jupyter
- Check Version of Package PIP
Python Debugging:
Fun Stuff:
- 5 Cheat Sheets Every Python Coder Needs to Own
- 10 Best Python Puzzles to Discover Your True Skill Level
- How to $1000 on the Side as a Python Freelancer
Thanks for learning with Finxter!

While working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students.
To help students reach higher levels of Python success, he founded the programming education website Finxter.com that has taught exponential skills to millions of coders worldwide. He’s the author of the best-selling programming books Python One-Liners (NoStarch 2020), The Art of Clean Code (NoStarch 2022), and The Book of Dash (NoStarch 2022). Chris also coauthored the Coffee Break Python series of self-published books. He’s a computer science enthusiast, freelancer, and owner of one of the top 10 largest Python blogs worldwide.
His passions are writing, reading, and coding. But his greatest passion is to serve aspiring coders through Finxter and help them to boost their skills. You can join his free email academy here.