diff --git a/app/storage.py b/app/storage.py index 03d419e..b9bf4ab 100644 --- a/app/storage.py +++ b/app/storage.py @@ -88,7 +88,13 @@ class S3Storage: region: str = "auto", public_url: str = "", ) -> None: - import boto3 + try: + import boto3 + except ImportError: + raise ImportError( + "boto3 is required for S3 storage. " + "Install it with: pip install boto3" + ) self.bucket = bucket self.public_url = public_url.rstrip("/") diff --git a/requirements.txt b/requirements.txt index ae631c7..96a5d08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ jinja2 bcrypt python-jose[cryptography] aiofiles +boto3