当我运行程序时,显示了无法从“telegram.ext”导入名称“Chat”之类的消息。我该怎么做才能解决这个问题?

问题描述 投票:0回答:2

当我运行程序时,屏幕上显示消息无法从“telegram.ext”导入名称“Chat”。我该怎么办?

它发生在我安装 python-telegram-bot 库和电报库时。大家可以解答一下吗🙏。谢谢你☺️

python bots telegram python-telegram-bot
2个回答
0
投票

telegram.ext
包没有名为
Chat
的类。不过,
telegram
包确实如此:https://docs.python-telegram-bot.org/en/stable/telegram.chat.html.

还请注意,https://pypi.org/project/telegramhttps://pypi.org/project/python-telegram-bot/无关,安装这两个库都会导致问题。我建议在重新安装

telegram
之前卸载
python-telegram-bot


免责声明:我目前是

python-telegram-bot
的维护者。


0
投票

不幸的是,“我建议在重新安装 python-telegram-bot 之前卸载 telegram。”没有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.