Reputation: 81
I tried:
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.
my text editor plugin can find the package
Upvotes: 3
Views: 20541
Reputation: 11
your file is called telegarm.py
well, at least mine was.
rename your python file to something like telegram-bot.py
and it should work fine.
Upvotes: 0
Reputation: 13
pip3/pip uninstall python-telegram-bot
pip3/pip uninstall telegram
pip3/pil install python-telegram-bot==13.14
This method solved my problem
Upvotes: 1
Reputation: 51
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:
python3 -m pip install python-telegram
(or simply python instead of python3 for some environments)
Upvotes: 0
Reputation: 41
Do 1-2 via terminal and 4 on your IDE:
pip install telegram
pip install python-telegram-bot
Upvotes: 1
Reputation: 81
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.
Upvotes: 5
Reputation: 98
It seems both packages python-telegram-bot
and telegram
uses the same namespace "telegram". This can cause conflicts, so you should remove one of them.
This uninstalls the telegram
package
pip uninstall telegram
Note: use pip3
if on Linux or Mac
Upvotes: 0