-1

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))
Bart
  • 9,825
  • 5
  • 47
  • 73
  • Perhaps useful: https://stackoverflow.com/q/36250353/18470692. – ouroboros1 Aug 20 '23 at 12:09
  • If I remember correctly I once had one package that also used import emoji and was not this one https://pypi.org/project/emoji/ can you verify that you are using this package and an up to date version `import emoji; print(emoji.__version__)`, further there is *no subfolder or file name emoji(.py)* in your directory. – Daraan Aug 20 '23 at 12:58
  • @ouroboros1 that's a good thought, but the error message indicates it's not the same problem. Unless there's *another* file `emoji.py` in the same directory. – Mark Ransom Aug 20 '23 at 15:31

1 Answers1

0

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

smiley = emoji.emojize(':smile:', language='alias')
toyota Supra
  • 3,181
  • 4
  • 15
  • 19
C.Vlad
  • 16
  • 1