Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

How can I know which compiler is used when I type python in terminal?

share|improve this question
Related from Stack Overflow: how to check which compiler was used to build Python – Cristian Ciupitu Jul 21 at 22:56

3 Answers 3

up vote 2 down vote accepted

Ask it.

$ python -V
Python 2.6.4
share|improve this answer
Is it the compiler name or just the python version? – Nick.h Sep 27 '11 at 20:28
The compiler is CPython. Jython is invoked as jython or some variant thereof, and IronPython is invoked as IronPython.exe. – Ignacio Vazquez-Abrams Sep 27 '11 at 20:30
Is there a command to get CPython? – Nick.h Sep 27 '11 at 20:35
Yes. The command is python. – Ignacio Vazquez-Abrams Sep 27 '11 at 21:12
python is not a compiler but an interpreter. @Nick.h CPython ( is a common python interpreter. – Matteo Sep 28 '11 at 6:40
$ which python


This will tell you which python is being used.

share|improve this answer
It is possible that this command could differ from the version of python being used, as it only considers $PATH. It's better practise to use type -p. – Chris Down Sep 27 '11 at 21:11
Good info, thanks Chris. – Somantra Sep 27 '11 at 21:15

When you run


in your terminal, no compiler is used. Python interprets the file

share|improve this answer
Incorrect. Python bytecompiles the script, and then runs the bytecode in its VM. – Ignacio Vazquez-Abrams Sep 28 '11 at 5:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.