Created
June 4, 2024 12:31
-
-
Save atemate/7e08e0ea2486e7f9dde1262766bbe0b3 to your computer and use it in GitHub Desktop.
Python code to check if extras is installed
This file contains 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
import importlib | |
# require installation of 'gcp' extras | |
try: | |
importlib.util.find_spec("google.cloud") | |
except ImportError: | |
raise ValueError("Please install package[gcp]") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment