10

I'm trying to create an Instagram bot using InstaPy. I'm following this tutorial.

When I ran:

from instapy import InstaPy

session = InstaPy(username="your username", password="your password")
session.login()

I got this error:

ImportError: cannot import name 'UNICODE_EMOJI' from 'emoji.unicode_codes' (C:\Users\roeegg22\AppData\Local\Programs\Python\Python310\lib\site-packages\emoji\unicode_codes\__init__.py)

I tried some solutions online, but none of them worked.

Filip Müller
  • 1,096
  • 5
  • 18
Roee Toledano
  • 125
  • 1
  • 1
  • 5

1 Answers1

23

This happens because instapy (or some other library) doesn't reflect the latest update to the emoji library. You should be able to fix it by running

pip uninstall emoji
pip install emoji==1.7

in the terminal. That way you install the version of emoji library that instapy is made around and the import should work.

Filip Müller
  • 1,096
  • 5
  • 18
  • 1
    Helped with [pilmoji](https://github.com/jay3332/pilmoji) as well – omegastripes Aug 18 '22 at 18:38
  • 1
    After this error I got a Clarifai.rest import error. Which lead me here https://stackoverflow.com/questions/75596471/error-while-working-with-instapy-modulenotfounderror-no-module-named-clarifa/75749692#75749692 – Michael Hearn Mar 15 '23 at 20:29