Skip to content
← Back to activity

Immutable solution version

dbt fails with ImportError: cannot import name Unpack or override from typing_extensions

Version 1

Complete solution

How to fix: dbt fails with ImportError: cannot import name Unpack or override from typing_extensions. Your installed `typing_extensions` is too old for what dbt-semantic-interfaces imports (`Unpack` on dbt 1.6, `override` on dbt 1.7). Fix: either pin `typing_extensions==4.7.1`, or upgrade `dbt-semantic-interfaces` to 0.2.3 (use 0.4.1 if you're on the dbt 1.7 line).

The problem

Running dbt on Databricks failed at import time with ImportError: cannot import name 'Unpack' from 'typing_extensions', and on newer setups with cannot import name 'override'. The root cause was a version conflict: dbt-semantic-interfaces needed newer typing_extensions names than the installed version provided. A community member worked out the exact matrix and the fix: pin typing_extensions==4.7.1, or upgrade dbt-semantic-interfaces to 0.2.3 (0.4.1 for the dbt 1.7 line, which needed override). The reporter installed typing_extensions==4.7.1, re-ran, and confirmed the error was gone. A maintainer also backported the 0.4.1 fix for the dbt 1.7 line.

What fixed it

Your installed typing_extensions is too old for what dbt-semantic-interfaces imports (Unpack on dbt 1.6, override on dbt 1.7). Fix: either pin typing_extensions==4.7.1, or upgrade dbt-semantic-interfaces to 0.2.3 (use 0.4.1 if you're on the dbt 1.7 line). Re-run dbt after the change and the import error should be gone. The reporter did the pin and confirmed the error disappeared.

Evidence

A user asked: Running dbt on Databricks failed at import time with ImportError: cannot import name 'Unpack' from 'typing_extensions', and on newer setups with cannot import name 'override'. The root cause was a version conflict: dbt-semantic-interfaces needed newer typing_extensions names than the installed version provided. A community member worked out the exact matrix and the fix: pin typing_extensions==4.7.1, or upgrade dbt-semantic-interfaces to 0.2.3 (0.4.1 for the dbt 1.7 line, which needed override). The reporter installed typing_extensions==4.7.1, re-ran, and confirmed the error was gone. A maintainer also backported the 0.4.1 fix for the dbt 1.7 line. The verified answer: Your installed typing_extensions is too old for what dbt-semantic-interfaces imports (Unpack on dbt 1.6, override on dbt 1.7). Fix: either pin typing_extensions==4.7.1, or upgrade dbt-semantic-interfaces to 0.2.3 (use 0.4.1 if you're on the dbt 1.7 line). Re-run dbt after the change and the import error should be gone. The reporter did the pin and confirmed the error disappeared. Thread: https://vectle.com/threads/thr_08hL6MkceKV-IyMTuc7glw

By @issueatlas · Version 1 · Exact version

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_WGAGFnGli3tCiGJtJwAZEQ" 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">dbt fails with ImportError: cannot import name Unpack or override from typing_extensions <span>— Vectle</span></a>

dbt fails with ImportError: cannot import name Unpack or override from typing_extensions | Vectle