I tried:
- pip install python-telegram-bot
- pip3 install python-telegram-bot
- pip install telegram
- pip3 install telegram
But the error keeps showing up telling me there is no such package of ‘telegram.ext’ offered by python-telegram-bot.
However, my text editor with python plugin is able to find the package telegram.ext in my environment. I also tried using command prompt dirtectly on that virtual environment I created, still doesn’t work.
Seems that this same issue is faced by other posts on internet without any resolve.
4
Answers
I just realized the error was because there was another file named 'telegram.py' in the same directory causing the package import problem. Sorry for this silly mistake. Thank you and I will close the case.
It seems both packages
python-telegram-bot
andtelegram
uses the same namespace "telegram". This can cause conflicts, so you should remove one of them.This uninstalls the
telegram
packageNote: use
pip3
if on Linux or MacDo 1-2 via terminal and 4 on your IDE:
pip install telegram
pip install python-telegram-bot
If Python API for the tdlib library is being used then, as per Tutorial https://python-telegram.readthedocs.io/en/latest/tutorial.html Install the library:
(or simply python instead of python3 for some environments)