如何导入python中的telegram.ext

发布于 2025-01-21 19:22:37 字数 125 浏览 0 评论 0原文

从telegram.ext导入(Updater,CommandHandler)。 iam运行此内容,如modulenotfounderror:no模块名为'telegram.ext'; “电报”不是一个包裹,

我该怎么办。

from telegram.ext import (Updater, CommandHandler) . iam running this it shows like ModuleNotFoundError: No module named 'telegram.ext'; 'telegram' is not a package

what should i do.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

笔芯 2025-01-28 19:22:37
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
相思故 2025-01-28 19:22:37

我认为问题是Pycharm或您的IDE为该项目创建了一个环境,并且库是全球安装的,而不是在项目中安装。

I think the problem is pycharm or your IDE created an env for the project, and the library is installed globaly, not in the env for the project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文