emoji in PyCharm

0

I'm using pycharm, I've already downloaded the emoji module, and still this message appears:

Traceback (most recent call last):
  File "C:/Users/Aspire/Desktop/curso-de-py-gua/aula08.modulos/ex.gua/emoji.py", line 1, in <module>
    import emoji
  File "C:\Users\Aspire\Desktop\curso-de-py-gua\aula08.modulos\ex.gua\emoji.py", line 2, in <module>
    print(emoji.emojize('olá mundo :punch:',use_aliases=True))
AttributeError: module 'emoji' has no attribute 'emojize'

The code:

import emoji
print(emoji.emojize('olá mundo :punch:',use_aliases=True))
    
asked by anonymous 25.10.2017 / 22:48

1 answer

2

I'm not sure, but I think you named your main script with the same name as the emoji lib, so at the time of import emoji it ends up importing the main script instead of the lib class. >

Rename your main script from emoji.py to something like app.py and try again.

    
25.10.2017 / 22:59