emoji no Pycharm

Asked

Viewed 2,725 times

0

I’m using pycharm, I’ve downloaded the emoji module and yet 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))

1 answer

2

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

Change the name of your main script from emoji.py for something like app.py and test again.

  • our was because of this, agr gave another problem that is, the emoji appears black instead of yellow but, thank you very much.

  • @I will test, but it is possible that it is because of your windows, does not have support for colorful emojis, could you mark the answers as correct? If you do not know how to view the details in https://pt.meta.stackoverflow.com/q/1078/3635

  • 1

    yes yes, thanks, it helped a lot

  • @Lucas mark the answer as correct please, if you do not know how to view this tutorial: https://pt.meta.stackoverflow.com/q/1078/3635

  • 1

    Thanks!! This and the solution, was also with this problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.