Just-Jojo / JojoCogs

Cogs I have written/rewritten for V3 of Red - Discord Bot
MIT License
14 stars 12 forks source link

ImportError: cannot import name 'UNICODE_EMOJI_ENGLISH' from 'emoji.unicode_codes' #77

Closed Macleykun closed 2 years ago

Macleykun commented 2 years ago

Cog

AdvancedInvite

Details

After doing: load advancedinvite it doens't load instead throws an import error.

Discord User Information

Macley#6969 | I'm also in the server :) dm is open!

Traceback details (if applicable)

[20:10:23] ERROR    [red] Package loading failed
╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮
│ /home/macley/redenv/lib/python3.9/site-packages/redbot/core/core_commands.py:172 in _load                                                                                        │
│ ❱  172                 await bot.load_extension(spec)                                                                                                                            │
│ /home/macley/redenv/lib/python3.9/site-packages/redbot/core/bot.py:1554 in load_extension                                                                                        │
│ ❱ 1554         lib = spec.loader.load_module()                                                                                                                                   │
│ <frozen importlib._bootstrap_external>:529 in _check_name_wrapper                                                                                                                │
│ <frozen importlib._bootstrap_external>:1029 in load_module                                                                                                                       │
│ <frozen importlib._bootstrap_external>:854 in load_module                                                                                                                        │
│ <frozen importlib._bootstrap>:274 in _load_module_shim                                                                                                                           │
│ <frozen importlib._bootstrap>:711 in _load                                                                                                                                       │
│ <frozen importlib._bootstrap>:680 in _load_unlocked                                                                                                                              │
│ <frozen importlib._bootstrap_external>:850 in exec_module                                                                                                                        │
│ <frozen importlib._bootstrap>:228 in _call_with_frames_removed                                                                                                                   │
│ /home/macley/.local/share/Red-DiscordBot/data/Deltabot/cogs/CogManager/cogs/advancedinvite/__init__.py:6 in <module>                                                             │
│ ❱  6 from .advanced_invite import AdvancedInvite                                                                                                                                 │
│ /home/macley/.local/share/Red-DiscordBot/data/Deltabot/cogs/CogManager/cogs/advancedinvite/advanced_invite.py:17 in <module>                                                     │
│ ❱  17 from .utils import *                                                                                                                                                       │
│ /home/macley/.local/share/Red-DiscordBot/data/Deltabot/cogs/CogManager/cogs/advancedinvite/utils.py:10 in <module>                                                               │
│ ❱  10 from emoji.unicode_codes import UNICODE_EMOJI_ENGLISH                                                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'UNICODE_EMOJI_ENGLISH' from 'emoji.unicode_codes'
(/home/macley/.local/share/Red-DiscordBot/data/Deltabot/cogs/Downloader/lib/emoji/unicode_codes/__init__.py)

Reproduction

Get latest version of Red on ubuntu 22.04 fully up-to-date. Install the repo through discord and install the cog and load it in.

Kreusada commented 2 years ago

Output from python -m pip freeze | grep emoji in your venv? Looks like Jojo will need to pin a specific version of this library to prevent errors as such.

Macleykun commented 2 years ago

Output from python -m pip freeze | grep emoji in your venv? Looks like Jojo will need to pin a specific version of this library to prevent errors as such.

In and outside the redenv gives no output sadly. I asume the emoji lib isn't installed when installing the cog?

Macleykun commented 2 years ago

I think version 1.7.0 should be good: https://pypi.org/project/emoji/#history

As the last update on that cog was 6 july, and 10 days later 2.0.0 came out. I'm not sure if i can test this out however.

Macleykun commented 2 years ago

thx for the fix!