Python Version

How to check your Python version?

Simple Answer: To check your Python version, run the command python –version in your command line.

This general method works across all major operating systems. In the following, I will show you exactly how to check your Python version for different operating systems.

Do you struggle with learning Python? Join my free Python Email Course! My subscribers love it.

Check Python Version Windows 10 (Exact Steps)

  • Open the Powershell application: Press the windows key to open the start screen. Then type in the search box the word “powershell”. Press enter.
  • Execute command: type in the command “python –version” and press enter.
  • The Python version appears in the next line right below your command.

Check Python Version Windows 7 (Exact Steps)

  • Open the command prompt application: Press the windows key to open the start screen. Then type in the search box the word “command”. Click on the command prompt application.
  • Execute command: type in the command “python –version” and press enter.
  • The Python version appears in the next line right below your command.

Check Python Version Mac (Exact Steps)

  • Press CMD + Space to open the spotlight search.
  • Type in the word “terminal” and press enter.
  • Execute command: type in the command “python -V” and press enter.
  • The Python version appears in the next line right below your command.

Check Python Version Ubuntu (Exact Steps)

  • Open the Dash by clicking to the upper left symbol.
  • Type in the search phrase “terminal”
  • Open the terminal application by clicking on the symbol that appears because of your search.
  • Execute command: type in the command “python -V” and press enter.
  • The Python version appears in the next line right below your command.

Check Python Version Linux (Exact Steps)

  • Open the terminal application (e.g. bash).
  • Execute command: type in the command “python -V” and press enter.
  • The Python version appears in the next line right below your command.

Check Python Version Jupyter

  • Open the Jupyter notebook by typing “jupyter notebook” in your terminal / console
  • Copy the following Python code snippet in your jupyter notebook:

from platform import python_version
print(python_version())

  • Execute the script.

Here is a screenshot on my computer:

What are the different Python versions?

Python has three main versions: version 1, version 2, and version 3. Version 4 is currently (2019) under development.

Here is the version history from Wikipedia.

  • Python 0.9.0 – February 20, 1991
    • Python 0.9.1 – February, 1991
    • Python 0.9.2 – Autumn, 1991
    • Python 0.9.4 – December 24, 1991
    • Python 0.9.5 – January 2, 1992
    • Python 0.9.6 – April 6, 1992
    • Python 0.9.8 – January 9, 1993
    • Python 0.9.9 – July 29, 1993
  • Python 1.0 – January 1994
    • Python 1.2 – April 10, 1995
    • Python 1.3 – October 12, 1995
    • Python 1.4 – October 25, 1996
    • Python 1.5 – December 31, 1997
    • Python 1.6 – September 5, 2000
  • Python 2.0 – October 16, 2000
    • Python 2.1 – April 15, 2001
    • Python 2.2 – December 21, 2001
    • Python 2.3 – July 29, 2003
    • Python 2.4 – November 30, 2004
    • Python 2.5 – September 19, 2006
    • Python 2.6 – October 1, 2008
    • Python 2.7 – July 3, 2010
  • Python 3.0 – December 3, 2008
    • Python 3.1 – June 27, 2009
    • Python 3.2 – February 20, 2011
    • Python 3.3 – September 29, 2012
    • Python 3.4 – March 16, 2014
    • Python 3.5 – September 13, 2015
    • Python 3.6 – December 23, 2016
    • Python 3.7 – June 27, 2018

As there are some major differences in syntax, you should always install the latest version in Python. Keep yourself updated on the official Python website here.

How to upgrade to a newer version?

If you are on Python 2 and want to upgrade to the latest version of Python 3, you have to install Python 3 from scratch. Download the latest version here.

If you are on Python 3 and want to update to a later version (e.g. from Python 3.4 to Python 3.7), you have to do exactly the same: install the preferred version from scratch. There is no simpler way to upgrade a Python version.

Now, of course, you will run in the following problem: how to run a specific Python version. Check out this StackOverflow answer to learn the exact steps:

Where to go from here?

Do you struggle with Python? Do you have difficulties understanding (and writing) Python source code?

I have created a free email course for you. The course guides you step-by-step to a deeper and deeper Python level of code understanding. Here is what my readers say:

Thank you for your newsletter. I find these newsletters highly informative.

Collen

As a fellow educator and fellow (former) Ph.D. student, I just wanted to let you know that I’m really impressed with your teaching materials.You’re doing a really good job!

Daniel