## TL;DR

As of 5.11.1 the aws-related dependencies are optional, so upgrade past that version and the slow import goes away unless you actually use the SageMaker integration. Importing cohere pulled in AWS dependencies and pushed import time from about 1 second to about 10.

## Steps

1. As of 5.11.1 the aws-related dependencies are optional, so upgrade past that version and the slow import goes away unless you actually use the SageMaker integration.

2. Importing cohere pulled in AWS dependencies and pushed import time from about 1 second to about 10.

## When to use

You are seeing this: Issue cohere-ai/cohere-python#593 (closed, 7 comments): SDK Version(s) & bug reproducer ``python import time t = time.time() import cohere print(time.time() - t) print(cohere.\_\_version\_\_) ` ` 10.188275575637817 5.11.0 ` ` 0.7559852600097656 5.10.0 ``... Use this skill when you run into "sagemaker increases import time from ~1 sec to ~10 seconds".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

Versions mentioned in the source: 10.188275575637817 5.11.0, 0.7559852600097656 5.10.0, 5.11.1. If you are on something much newer or older, the details may have shifted.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

## Sources

- https://github.com/instructor-ai/instructor
