microsoft / Recognizers-Text

Microsoft.Recognizers.Text provides recognition and resolution of numbers, units, date/time, etc. in multiple languages (ZH, EN, FR, ES, PT, DE, IT, TR, HI, NL. Partial support for JA, KO, AR, SV). Packages available at: https://www.nuget.org/profiles/Recognizers.Text, https://www.npmjs.com/~recognizers.text
MIT License
1.66k stars 429 forks source link

ImportError: cannot import name 'UNICODE_EMOJI' from 'emoji' #3139

Open chansonzhang opened 10 months ago

chansonzhang commented 10 months ago

Describe the bug ImportError: cannot import name 'UNICODE_EMOJI' from 'emoji'

To Reproduce Steps to reproduce the behavior:

  1. pip install emoji==2.8.0
  2. pip install recognizers-text-date-time==1.0.2a2
  3. python -c "from recognizers_date_time import DateTimeRecognizer"

Expected behavior No error occurred.

Sample input/output N/A

Platform (please complete the following information):

Additional context ImportError: cannot import name 'UNICODE_EMOJI' from 'emoji'

aymenkrifa commented 9 months ago

Hello @chansonzhang, I had a similar issue, and the 'solution' I found was to downgrade the emoji package to version 1.7.0.

pip install emoji==1.7.0

The problem stems from the fact that the latest version of the recognizers-text-date-time package, along with its dependency recognizers-text, was released in November 2019 and hasn't been updated since then. Additionally, recognizers-text relies on the emoji package.

The issue arises because the emoji package made significant changes starting from version 2.0.0, leading to the ImportError you mentioned.

I hope this solution proves helpful to you! 😃