我安装了电报包。但是当我尝试运行简单示例 echobot.py 时,出现错误:
Traceback (most recent call last):
File "echobot.py", line 8, in <module>
import telegram ImportError: No module named 'telegram'
谁能帮我?
我使用 git 安装:
$ git clone https://github.com/python-telegram-bot/python-telegram-bot
在这之后:
$ python -i
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import telegram
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'telegram'
原文由 Mahyar 发布,翻译遵循 CC BY-SA 4.0 许可协议
你没有安装它。你只是在下载它。
运行这些:
(在 GitHub 页面的自述文件中说明)
或者,您可以使用 pip。它更容易使用。