Skip to content

Instantly share code, notes, and snippets.

@icoxfog417
Created September 10, 2015 08:07
Show Gist options
  • Save icoxfog417/9d4b25af40e53b697951 to your computer and use it in GitHub Desktop.
Save icoxfog417/9d4b25af40e53b697951 to your computer and use it in GitHub Desktop.
check package existence in Python3
def check(name):
from importlib import util
spec = util.find_spec(name)
return True if spec else False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment