diff --git a/faststream/__main__.py b/faststream/__main__.py index 0778ba8f36..04378c618e 100644 --- a/faststream/__main__.py +++ b/faststream/__main__.py @@ -2,7 +2,20 @@ import warnings -from faststream.cli.main import cli +try: + from faststream.cli.main import cli +except ImportError: + has_typer = False +else: + has_typer = True + +if not has_typer: + raise ImportError( + "\n\nYou're trying to use the FastStream CLI, " + "\nbut you haven't installed the required dependencies." + "\nPlease install them using the following command: " + '\npip install "faststream[cli]"' + ) warnings.filterwarnings("default", category=ImportWarning, module="faststream")