ImportError: cannot import name 'ParseMode' from 'telegram'
Question:
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:ProgramDataAnaconda3libsite-packagestelegram__init__.py)
Could you please advise how to fix this error?
Answers:
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"
as per Version 20 you need to use:
from telegram.constants import ParseMode
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:ProgramDataAnaconda3libsite-packagestelegram__init__.py)
Could you please advise how to fix this error?
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"
as per Version 20 you need to use:
from telegram.constants import ParseMode