Friday, December 22, 2017

Finding the python path in windows

I have two pythons installed on my windows 7 machine. I need to know which python is marked as default. I am not using any virtual environment for python.

Open your cmd prompt.
Type python
>>> import os
>>> import sys
>>> os.path.dirname(sys.executable)
'C:\\Python3'

 

No comments:

Post a Comment