Finding out the Python used to install the current package? -


this question has answer here:

is there way programmatically find python version used install current package?

if have package called mypackage , has in setup.py like:

scripts = ["myscript.py"] 

suppose install package easy_install or pip using particular python version, python 2.x:

/usr/local/bin/python2.x setup.py install 

then in myscript.py, how can find out /usr/local/bin/python2.x used install mypackage myscript.py opposed other python version available on system? i'd know full path , not version info because want use /usr/local/bin/python2.x in script.

use sys.executable.

a string giving absolute path of executable binary python interpreter, on systems makes sense. if python unable retrieve real path executable, sys.executable empty string or none.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -