Skip to content

Instantly share code, notes, and snippets.

@rbellamy
Forked from vlasovskikh/check_python_interpreter.py
Last active November 8, 2017 20:44
Show Gist options
  • Save rbellamy/e123a936c601cb8af719ec055fcb7225 to your computer and use it in GitHub Desktop.
Save rbellamy/e123a936c601cb8af719ec055fcb7225 to your computer and use it in GitHub Desktop.
Information about Python interpreter and environment
import sys
import os
import pkg_resources
from pprint import pprint
pprint({
'sys.version_info': sys.version_info,
'sys.prefix': sys.prefix,
'sys.path': sys.path,
'pkg_resources.working_set': list(pkg_resources.working_set),
'os.environ': {
name: value.split(os.pathsep) if 'PATH' in name else value
for name, value in os.environ.items()
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment