'Installed python-telegram-bot but still showing "No module named 'telegram'"
Hi I already installed Python-telegram-bot using pip install python-telegram-bot. However, when i run my python file in VS, it shows "No module named 'telegram'. I confirmed that i only have 1 version of python installed 3.8.3 and still unable to find any solution.
I have anaconda installed as well, and i am not sure if it is the cause to this issue.
The error is prompted in the line below:
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
Solution 1:[1]
After installing python-telegram-bot, you should use telegram.ext for all functions you want to use for example
Telegram.ext.CommanHandler()
Telegram.ext.MessageHandler(Telegram.ext.Filter.text,function-name)
We use that because we have to show the address for Telegram.ext function
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Muhammad Mohsin Khan |