boto/boto3 · error · MissingDependencyException

CRT transfer client is configured but is missing minimum crt

Error message

CRT transfer client is configured but is missing minimum crt version. CRT installed: {HAS_CRT}[, with version: {awscrt.__version__}]

What it means

Raised as MissingDependencyException when a TransferConfig explicitly requests the CRT transfer client (preferred_transfer_client='crt') but awscrt is either not installed or older than the required 0.19.18. _should_use_crt() checks HAS_CRT and has_minimum_crt_version((0,19,18)); if the user pinned the CRT client without satisfying the dependency, boto3 refuses to silently fall back and surfaces the missing dependency. The message reports whether CRT is installed and, if so, the detected awscrt.__version__.

Source

Thrown at boto3/s3/transfer.py:209


def _should_use_crt(config):
    # This feature requires awscrt>=0.19.18
    has_min_crt = HAS_CRT and has_minimum_crt_version((0, 19, 18))
    is_optimized_instance = has_min_crt and awscrt.s3.is_optimized_for_system()
    pref_transfer_client = config.preferred_transfer_client.lower()

    if (
        pref_transfer_client == constants.CRT_TRANSFER_CLIENT
        and not has_min_crt
    ):
        msg = (
            "CRT transfer client is configured but is missing minimum CRT "
            f"version. CRT installed: {HAS_CRT}"
        )
        if HAS_CRT:
            msg += f", with version: {awscrt.__version__}"
        raise MissingDependencyException(msg=msg)

    if (
        is_optimized_instance
        and pref_transfer_client == constants.AUTO_RESOLVE_TRANSFER_CLIENT
    ) or pref_transfer_client == constants.CRT_TRANSFER_CLIENT:
        logger.debug(
            "Attempting to use CRTTransferManager. Config settings may be ignored."
        )
        return True

    logger.debug(
        "Opting out of CRT Transfer Manager. "
        "Preferred client: %s, CRT available: %s, Instance Optimized: %s",
        pref_transfer_client,
        HAS_CRT,
        is_optimized_instance,
    )
    return False

View on GitHub (pinned to c7b4afac23)

Solutions

  1. Install or upgrade awscrt to at least 0.19.18: pip install -U 'awscrt>=0.19.18'.
  2. If you do not need the CRT client, switch preferred_transfer_client back to 'auto' (the default) or omit it so boto3 uses the default transfer manager.
  3. Pin awscrt in your requirements alongside boto3 so deployments stay consistent.
  4. Verify the installation in the runtime environment (not just your dev machine) with python -c 'import awscrt; print(awscrt.__version__)'.

Example fix

// before
cfg = TransferConfig(preferred_transfer_client='crt')  # raises if awscrt missing
s3.upload_file('f', 'bkt', 'key', Config=cfg)

// after
# Option A: install awscrt>=0.19.18, OR
# Option B: drop the CRT preference
cfg = TransferConfig()  # default transfer client
s3.upload_file('f', 'bkt', 'key', Config=cfg)
Defensive patterns

Strategy: validation

Validate before calling

from botocore.compat import HAS_CRT
from boto3.s3.transfer import has_minimum_crt_version
if config.preferred_transfer_client == 'crt' and not has_minimum_crt_version((0, 19, 18)):
    raise RuntimeError('awscrt>=0.19.18 required for CRT transfer client')

Type guard

def crt_client_available() -> bool:
    from botocore.compat import HAS_CRT
    from boto3.s3.transfer import has_minimum_crt_version
    return HAS_CRT and has_minimum_crt_version((0, 19, 18))

Try / catch

from botocore.exceptions import MissingDependencyException
try:
    s3.upload_file(fn, bucket, key, Config=config)
except MissingDependencyException as e:
    if 'CRT transfer client' in str(e):
        s3.upload_file(fn, bucket, key)  # fall back to default transfer client

Prevention

When it happens

Trigger: Constructing a TransferConfig with preferred_transfer_client set to 'crt' (boto3.s3.constants.CRT_TRANSFER_CLIENT) and then performing any S3 transfer (upload_file/download_file/upload_fileobj/download_fileobj) that calls create_transfer_manager, while awscrt is absent or < 0.19.18.

Common situations: Deploying to an environment (Lambda layer, slim Docker image, CI) where awscrt was not installed; pinning an older awscrt that predates the 0.19.18 cutoff; explicitly opting into the CRT client for performance on EC2 without adding the awscrt dependency.

Related errors


AI-assisted analysis of boto/boto3@c7b4afac23 (2026-08-04). Data as JSON: /data/errors/7b20d951595cd077.json. Report an issue: GitHub.