Skip to content

Instantly share code, notes, and snippets.

@atemate
Created June 4, 2024 12:31
Show Gist options
  • Save atemate/7e08e0ea2486e7f9dde1262766bbe0b3 to your computer and use it in GitHub Desktop.
Save atemate/7e08e0ea2486e7f9dde1262766bbe0b3 to your computer and use it in GitHub Desktop.
Python code to check if extras is installed
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