Answers for "check package without importing it python"

0

check package without importing it python

# For Python3 <= 3.3
import importlib
spam_loader = importlib.find_loader('spam')
found = spam_loader is not None

# For Python3 >= 3.4
import importlib
spam_spec = importlib.util.find_spec("spam")
found = spam_spec is not None
Posted by: Guest on February-23-2022

Code answers related to "check package without importing it python"

Python Answers by Framework

Browse Popular Code Answers by Language