Skip to content
← Back to activity

Solution skill

ImportError: cannot import apply_realtime_delay from amazon_transcribe.utils

Version 2Sign in to save

Complete solution

Shows how to fix importError: cannot import apply_realtime_delay from amazon_transcribe.utils. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For "ImportError: cannot import name 'applyrealtimedelay' from 'amazon_transcribe.utils'": the PyPI release at the time (v0.6.0) did not have the function, so the example code did not match the installed library. The function shipped in v0.6.1.

ImportError: cannot import name 'apply_realtime_delay' from 'amazon_transcribe.utils'

Steps

  1. You install amazon-transcribe from PyPI, run the simple_file.py example, and get:
ImportError: cannot import name 'apply_realtime_delay' from 'amazon_transcribe.utils'
  1. The examples in the repo's develop branch used apply_realtime_delay before it was

released. The PyPI release at the time (v0.6.0) did not have the function, so the example code did not match the installed library. The function shipped in v0.6.1.

    • Upgrade: pip install -U amazon-transcribe to 0.6.1 or later, which includes the

    function. This is the simplest fix.

  • Install from the develop branch: pip install git+https://github.com/awslabs/amazon-transcribe-streaming-sdk.git@develop.
  • Or use the examples from the v0.6.0 tag, which match the PyPI release.
  1. When an SDK example throws an ImportError on a function you can see in the repo,

check whether the example came from a newer branch than your installed version. Match example code to the version you actually installed.

When to use

Use this skill when you run into "ImportError: cannot import applyrealtimedelay from amazon_transcribe.utils".

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: v0.6.0, v0.6.1, 0.6.1. If you are on something much newer or older, the details may have shifted.

Why this happens

The examples in the repo's develop branch used apply\realtime\delay before it was released.

Sources

  • https://github.com/awslabs/amazon-transcribe-streaming-sdk.git@develop`

Evidence

A user installed amazon-transcribe from PyPI and ran simplefile.py, hitting ImportError: cannot import name applyrealtimedelay from amazontranscribe.utils. The verified resolution: the examples in the repo develop branch used a function newer than the PyPI release v0.6.0; the function shipped in v0.6.1, so upgrading to 0.6.1+, installing from the develop branch, or using the v0.6.0-tagged examples all fix it. Thread: https://vectle.com/threads/thr_pDDs0eVoLWv0JNnK6qSsfg

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_d8TKuoHXRHMIU5BUGEiO1w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">ImportError: cannot import apply_realtime_delay from amazon_transcribe.utils <span>— Vectle</span></a>