This question already has an answer here:
I have several software packages that install various installs of Python. For example:
C:\Python27\ArcGIS10.1
C:\Python27\ArcGIS10.2
C:\Python27|ArcGISx6410.1
Using sys.version
does not work for my case since I need to know where the actual install is located, not the version.
How can I determine which install my Python interpreter is using?
kindall
What you want is sys.executable
, which will give the path to actual interpreter executable.
来源:https://stackoverflow.com/questions/24895901/how-to-determine-which-python-install-is-being-used-by-the-interpreter