Source code for quantum_launcher.import_management
1""" Module for import management across the library. """
2# TODO: Consider moving this module to quantum_launcher.utils
3
4
[docs]
5class DependencyError(ImportError):
6 """ Error connected with missing optional dependencies and wrong installation. """
7
8 def __init__(self, e: ImportError, install_hint: str = '') -> None:
9 message = f"""Module "{e.name}" is required but not installed. Install it with: pip install "quantum_launcher[{install_hint}]"."""
10 super().__init__(message, name=e.name)