Search code examples
pythonimporterror-handlingemoji

AttributeError: module 'emoji' has no attribute 'emojize'


I'm starting in programming and I can't create a single emoji.

my code is:

import emoji
print(emoji.emojize('Python is :thumbs_up:'))
print(emoji.emojize("Ola Mundo :sunglasses:"))

error

Traceback (most recent call last):
  File "C:\Users\Cleid\OneDrive\Área de Trabalho\aulas python\aulas\a8.py", line 2, in <module>
    print(emoji.emojize('Python is :thumbs_up:'))
          ^^^^^^^^^^^^^
AttributeError: module 'emoji' has no attribute 'emojize'

what i do.

import emoji
print(emoji.emojize('Python is :thumbs_up:', use_aliases=True))

Solution

  • try putting in the round parentheses the command language = 'alias'.

    smiley = emoji.emojize(':smile:', language='alias')