Created
September 10, 2015 08:07
-
-
Save icoxfog417/9d4b25af40e53b697951 to your computer and use it in GitHub Desktop.
check package existence in Python3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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