welcomebot icon indicating copy to clipboard operation
welcomebot copied to clipboard

import error

Open zimler opened this issue 6 years ago • 3 comments

I'm trying to use your bot and am getting the following error: Traceback (most recent call last): File "bot.py", line 8, in from telegram import Emoji, ParseMode, TelegramError, Update ImportError: cannot import name 'Emoji'

I did a pip install of python-telegram-bot. Any thoughts?

zimler avatar Jun 13 '18 17:06 zimler

I am having the same problem..

  • Created virtualenv for python3.6 with virtualenv -p `which python3.6`
  • Activated virtualenv with . ./bin/activate
  • Ran pip install telegram
  • ./bin/python bot.py gives
  File "bot.py", line 8, in <module>
    from telegram import Emoji, ParseMode, TelegramError, Update
ImportError: cannot import name 'Emoji'```

allbinmani avatar Jul 10 '18 14:07 allbinmani

Solution found! It seems the Emoji support was deprecated in python-telegram-bot V5.1, so in order to make it work you have to install V5.0 using pip install python-telegram-bot==5.0

allbinmani avatar Jul 10 '18 14:07 allbinmani

Well, how about that. Good detective work. I'll try that later this week and report back. Depreciated on purpose? But why...

zimler avatar Jul 10 '18 14:07 zimler