Can't seem to edit the other answer. Has a minor error in that it is Windows-only. The more generic solution is to use os.seppathsep as below:
sys.path might include items that aren't specifically in your PYTHONPATH environment variable. To query the variable directly, use:
import os os.environ['PYTHONPATH']environ.get('PYTHONPATH', '').split(os.pathsep)