The Question :
496 people think this question is useful
How can I print the version number of the current Python installation from my script?
The Question Comments :
The Answer 1
620 people think this answer is useful
This prints the full version information string. If you only want the python version number, then Bastien Léonard’s solution is the best. You might want to examine the full string and see if you need it or portions of it.
The Answer 2
209 people think this answer is useful
This prints something like
The Answer 3
62 people think this answer is useful
This will return a current python version in terminal.
The Answer 4
34 people think this answer is useful
sys.version_info(major=3, minor=2, micro=2, releaselevel='final', serial=0)
maj_ver = sys.version_info.major
version = ".".join(map(str, sys.version_info[:3]))
The Answer 5
7 people think this answer is useful
If you are using jupyter notebook Try:
If you are using terminal Try: