Skip to content

Instantly share code, notes, and snippets.

@pmarques
Last active June 5, 2017 09:05
Show Gist options
  • Save pmarques/c45b137defa9fe2a808ad8b5bafde089 to your computer and use it in GitHub Desktop.
Save pmarques/c45b137defa9fe2a808ad8b5bafde089 to your computer and use it in GitHub Desktop.
Lambda function to print python installed packages
import pip
def lambda_handler(event, context):
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (pkg.key, pkg.version) for pkg in installed_packages])
print("\n".join(installed_packages_list))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment