HowTo: Find Python Version

by on July 8, 2009 · 4 comments· LAST UPDATED February 27, 2013


How do I find out python programming language version under UNIX / *BSD / Linux / Apple OS X operating systems?

You need to simply type the following command to find out python version (open a terminal windows or shell prompt):

python -V


python --version

Sample outputs:

Python 2.6.6

The -V or --version option shows the Python version number of the executable and exit.

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 4 comments… read them below or add one }

1 Jim Mooney June 9, 2013 at 8:34 pm

I’d like to know what version of Python a module is made for before I download it – 2.7 or 3.3. Often it’s not stated or I can’t figure how to find it. I’m not sure why they don’t make that clear or maybe I’m missing something because I’m new at it. I searched google for that idea but all it does is tells me how to find the Module version. I don’t want that. I want to know what version of python a module is for. It doesn’t seem to be clearly stated on download sites or even in the module or documentation.


2 Thota Madhu Sudhan June 21, 2013 at 7:14 am

I am getting ‘python’ is not defined


3 SYSDBA September 6, 2013 at 2:52 pm

Don’t type “python -V” at the python command prompt (interpreter) but at the command prompt of the shell you are using … here’s an example on Windows :

C:\Python33>python -V
Python 3.3.2

If you want to know from within python command prompt you will have to type …

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import sys
>>> sys.version
‘3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)]‘

Hope this helps.


4 Sam Putnam October 10, 2014 at 5:40 pm

How may one change the version of Python which they have installed?


Leave a Comment

Tagged as: , , , , , ,

Previous Faq:

Next Faq: