Skip to content

[QUESTION] ImportError: cannot import name 'Update' from 'telegram.ext' #1704

@staticdev

Description

@staticdev

Issue I am facing

I am migrating from version11 to 12 following https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 and created the new style handler as described:
def start(update: Update, context: CallbackContext):
But I get the error:
ImportError: cannot import name 'Update' from 'telegram.ext'
It is nowhere in the migration guide where to import it. It is also not in the first bot tutorial:
https://github.com/python-telegram-bot/python-telegram-bot/wiki/Extensions-%E2%80%93-Your-first-Bot (also this tutorial seems updated, it does not use the "new style").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions