Is there a way to programmatically find which Python version was used to install the current package?
If you have a package called mypackage
and it has in its setup.py
something like:
scripts = ["myscript.py"]
suppose install the package with easy_install
or pip
using a particular Python version, Python 2.x:
/usr/local/bin/python2.x setup.py install
Then in myscript.py
, how can you find out that it was /usr/local/bin/python2.x
that was used to install mypackage
from myscript.py
as opposed to some other Python version available on the system? I'd like to know the full path and not just the version info because I want to use /usr/local/bin/python2.x
in my script.