zhaobenny / bz-cogs

Interesting cogs for Red Bot
MIT License
23 stars 14 forks source link

ModuleNotFoundError in AI_User #11

Closed scarecr0w12 closed 1 year ago

scarecr0w12 commented 1 year ago

Hello, Recent updates are giving me the error now at load time:


Traceback (most recent call last):
  File "/root/redenv/lib/python3.11/site-packages/redbot/core/core_commands.py", line 188, in _load
    await bot.load_extension(spec)
  File "/root/redenv/lib/python3.11/site-packages/redbot/core/bot.py", line 1680, in load_extension
    lib = spec.loader.load_module()
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap_external>", line 605, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 1120, in load_module
  File "<frozen importlib._bootstrap_external>", line 945, in load_module
  File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 721, in _load
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/root/.local/share/Red-DiscordBot/data/LittleBot/cogs/CogManager/cogs/ai_user/__init__.py", line 1, in <module>
    from .ai_user import AI_User
  File "/root/.local/share/Red-DiscordBot/data/LittleBot/cogs/CogManager/cogs/ai_user/ai_user.py", line 15, in <module>
    from ai_user.prompts.image_prompt.ai_horde import AIHordeImagePrompt
ModuleNotFoundError: No module named 'ai_user.prompts.image_prompt.ai_horde'; 'ai_user.prompts.image_prompt' is not a package```
zhaobenny commented 1 year ago

Looks like it's looking for a non-existing file, seems to be a reoccuring issue after I moved a file.

Try reinstalling the cog and repo.

[p]cog uninstall ai_user
[p]repo delete bz-cogs

then reinstall

[p]repo add bz-cogs https://github.com/zhaobenny/bz-cogs
[p]cog install bz-cogs ai_user
zhaobenny commented 1 year ago

Try updating again too, I pushed some changes to hopefully resolve it.

scarecr0w12 commented 1 year ago

Now im getting:

[2023-05-09 17:46:12] [ERROR] red: Package loading failed
Traceback (most recent call last):
  File "/root/redenv/lib/python3.11/site-packages/redbot/core/core_commands.py", line 187, in _load
    self._cleanup_and_refresh_modules(spec.name)
  File "/root/redenv/lib/python3.11/site-packages/redbot/core/core_commands.py", line 266, in _cleanup_and_refresh_modules
    importlib._bootstrap._exec(lib.__spec__, lib)
  File "<frozen importlib._bootstrap>", line 621, in _exec
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/root/.local/share/Red-DiscordBot/data/LittleBot/cogs/CogManager/cogs/ai_user/prompts/embed_prompt.py", line 8, in <module>
    from ai_user.constants import MAX_MESSAGE_LENGTH
ModuleNotFoundError: No module named 'ai_user'

This is after doing a full uninstall and reinstall of Repo and cog

scarecr0w12 commented 1 year ago

All files are in place btw, compared Git to what I have locally.

zhaobenny commented 1 year ago

Resolved by restarting Redbot