Issue
I am trying to create a telegram bot. The code i am trying to execute is :
from telegram import ParseMode
But it is throwing up this error:
ImportError: cannot import name 'ParseMode' from 'telegram'
(C:\ProgramData\Anaconda3\lib\site-packages\telegram\__init__.py)
Could you please advise how to fix this error?
Solution
you have to import with this way:
from telegram.ext import ParseMode
if problem not solved:
install the package like this:
pip install python_telegram_bot
or
pip install "python_telegram_bot==12.4.2"
Answered By - Hamidreza Khorammfar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.