Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error "cannot import name 'UNICODE_EMOJI' from 'emoji.unicode_codes' "

Tags:

python

instapy

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.

like image 387
roeegg Avatar asked Mar 05 '26 14:03

roeegg


1 Answers

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.

like image 79
Filip Müller Avatar answered Mar 08 '26 03:03

Filip Müller