【发布时间】:2022-11-01 15:43:31
【问题描述】:
嘿,我试图编辑一个电报机器人,但这个错误不断出现。” import telegram.ext ModuleNotFoundError:没有名为“telegram.ext”的模块; ‘电报’不是一个包裹”。 我的代码是这样的: -
import telegram.ext
with open('token.txt', 'r') as f:
TOKEN = f.read()
def start(update, context):
update.message.reply_text("Helllo")
updater = telegram.ext.Updater(TOKEN, use_context=True)
disp = updater.dispatcher
```
`
any help will be appreciated
I've tried reinstalling python-telegram-bot.
【问题讨论】:
-
确保您实际安装了
python-telgeram-bot库,并且您正在从安装它的相同(虚拟)python 环境运行脚本。还要确保您没有名为“电报”的文件或目录
标签: python-telegram-bot python-3.11