Trying to run examples or telegram bots from official site – https://github.com/python-telegram-bot/python-telegram-bot/tree/master/examples
Installed :
pip install python-telegram-bot
and when i run the example, i got error back that version is not compatible.
if __version_info__ < (20, 0, 0, "alpha", 1):
raise RuntimeError(
f"This example is not compatible with your current PTB version {TG_VER}. To view the "
f"{TG_VER} version of this example, "
f"visit https://github.com/python-telegram-bot/python-telegram-bot/tree/v{TG_VER}/examples"
)
It installs PyPi version 13.12 but example checks different version v20. So, the error is reasonable.
How can I let example working?
2
Answers
Shame on me, I spent a couple of days to get the answer - 20x is pre-release version only! To find clear explanation, you have to read WiKi and not even on the first page - https://github.com/python-telegram-bot/python-telegram-bot/wiki/introduction-to-the-API That was the only source of info with clear answer with 20x status and right installation procedure. So, here is the procedure -
pip install python-telegram-bot -U --pre
btw, you have to check if "telegram" package installed also. Uninstall it first and then reinstall telegram-bot from the scratch (better with force option).Probably you are using examples from
v20.0
version, change the tag tov13.12