To check if a module is installed, you can simply try to import it:
try: import someModule except ImportError, e: pass
To check your path after importing it, you can access the __path__ attribute via someModule.__path__ :
Packages support another special __path__ attribute. This is initialized as a list containing the name of the directory containing the __init__.py packages before the code in this file is executed.
Regarding access to environment variables from Python , you can do the following:
import os os.environ['PATH']
source share