I’m trying to use the example codes from the repository’s beginners guide and the ready-made examples:
wiki&
examples
I can’t run them because of some classes that can’t be imported. I’m using Visual Studio and when debugging, find the following error
from telegram.ext import (
Application,
CallbackContext,
CommandHandler,
ConversationHandler,
MessageHandler,
filters,
)
gives this error
cannot import name 'Application' from 'telegram.ext'
Was it my mistake? I uninstalled and installed using pip, the error keeps showing up
2
Answers
I think you haven’t installed it correctly .
try installing it with setup.py in order to do that just follow these steps
1-
git clone "repository link"
2-
cd python-telegram-bot
3-
py setup.py install
orpython setup.py install
Your code has no problem.
if you encountered and error while doing this please do comment.
You are installing the alpha version which has a lot of changes.
To fix this issue:
pip install python-telegram-bot