Get Python Version and Installation Path – Python Tutorial

By | June 15, 2019

To get the version and installation of python, you can use sys model.

sys.executable: return the path of python.exe
sys.version: return the version of python.exe

Here is an example code:

import sys
print (sys.executable)
print(sys.version)

The output is:

c:\Program Files\Anaconda2\envs\python35\python.exe
3.5.4 |Continuum Analytics, Inc.| (default, Aug 14 2017, 13:41:13) [MSC v.1900 64 bit (AMD64)]

Leave a Reply

Your email address will not be published. Required fields are marked *