Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.79k stars 2.3k forks source link

Can't load audio cog on Linux #5314

Closed turtlenator0316 closed 3 years ago

turtlenator0316 commented 3 years ago

What Red version are you using?

3.4.13

Cog name

Audio

Command name

load

What did you expect to happen?

I tried to load the cog on a fresh install of Red on Raspbian

What actually happened?

I get through the install process of Red just fine. Start it up, add it to server, and then do --load audio and get the following error:

Sep 13 04:42:12 octopi python[1244]: Loaded 2 cogs with 38 commands Sep 13 04:42:12 octopi python[1244]: Invite URL: Sep 13 04:42:12 octopi python[1244]: https://discord.com/[redacted] Sep 13 04:46:39 octopi python[1244]: [2021-09-13 04:46:39] [ERROR] red: Package import failed Sep 13 04:46:39 octopi python[1244]: Traceback (most recent call last): Sep 13 04:46:39 octopi python[1244]: File "/home/pi/redenv/lib/python3.9/site-packages/redbot/core/core_commands.py", line 160, in _load Sep 13 04:46:39 octopi python[1244]: spec = await bot._cog_mgr.find_cog(name) Sep 13 04:46:39 octopi python[1244]: File "/home/pi/redenv/lib/python3.9/site-packages/redbot/core/cog_manager.py", line 288, in find_cog Sep 13 04:46:39 octopi python[1244]: return await self._find_core_cog(name) Sep 13 04:46:39 octopi python[1244]: File "/home/pi/redenv/lib/python3.9/site-packages/redbot/core/cog_manager.py", line 256, in _find_core_cog Sep 13 04:46:39 octopi python[1244]: mod = import_module(real_name, package=package) Sep 13 04:46:39 octopi python[1244]: File "/home/pi/.pyenv/versions/3.9.7/lib/python3.9/importlib/init.py", line 127, in import_module Sep 13 04:46:39 octopi python[1244]: return _bootstrap._gcd_import(name[level:], package, level) Sep 13 04:46:39 octopi python[1244]: File "", line 1030, in _gcd_import Sep 13 04:46:39 octopi python[1244]: File "", line 1007, in _find_and_load Sep 13 04:46:39 octopi python[1244]: File "", line 986, in _find_and_load_unlocked Sep 13 04:46:39 octopi python[1244]: File "", line 680, in _load_unlocked Sep 13 04:46:39 octopi python[1244]: File "", line 850, in exec_module Sep 13 04:46:39 octopi python[1244]: File "", line 228, in _call_with_frames_removed Sep 13 04:46:39 octopi python[1244]: File "/home/pi/redenv/lib/python3.9/site-packages/redbot/cogs/audio/init.py", line 3, in Sep 13 04:46:39 octopi python[1244]: from .core import Audio Sep 13 04:46:39 octopi python[1244]: File "/home/pi/redenv/lib/python3.9/site-packages/redbot/cogs/audio/core/init.py", line 19, in Sep 13 04:46:39 octopi python[1244]: from . import abc, cog_utils, commands, events, tasks, utilities Sep 13 04:46:39 octopi python[1244]: File "/home/pi/redenv/lib/python3.9/site-packages/redbot/cogs/audio/core/abc.py", line 18, in Sep 13 04:46:39 octopi python[1244]: from redbot.core.utils.dbtools import APSWConnectionWrapper Sep 13 04:46:39 octopi python[1244]: File "/home/pi/redenv/lib/python3.9/site-packages/redbot/core/utils/dbtools.py", line 7, in Sep 13 04:46:39 octopi python[1244]: import apsw Sep 13 04:46:39 octopi python[1244]: ImportError: libicui18n.so.67: cannot open shared object file: No such file or directory

How can we reproduce this error?

  1. Install Red
  2. Add to discord server
  3. Run load audio command ...

Anything else?

I've looked around on google for results but nothing seems to match or solve the problem. Any help is appreciated. Thanks.

benno1237 commented 3 years ago

I would highly recommend you to update your bot before doing any other troubleshooting. 3.4.5 is really oudated.

turtlenator0316 commented 3 years ago

I would highly recommend you to update your bot before doing any other troubleshooting. 3.4.5 is really oudated.

Sorry, I put 3.4.5 because that's what the template showed and I thought it was the latest. I just downloaded Red yesterday, so it should be on whatever the latest version is

yamikaitou commented 3 years ago

Please join us on Discord at discord.gg/red so we can assist in troubleshooting your issue

yamikaitou commented 3 years ago

After some troubleshooting on Discord, it looks like Debian Buster (and Raspberry Pi OS by association) doesn't have version 67 of libicu in the repos, only Bullseye (11) does.

turtlenator0316 commented 3 years ago

After some troubleshooting on Discord, it looks like Debian Buster (and Raspberry Pi OS by association) doesn't have version 67 of libicu in the repos, only Bullseye (11) does.

What can I do to amend this without installing a new OS? (Sorry, not super versed with Linux. If you have a command that I can just paste to install it, that would be greatly appreciated)

yamikaitou commented 3 years ago

So I've managed to trace/confirm the issue to Raspberry Pi OS and Python 3.9 (Python 3.8 works fine and both 3.8 and 3.9 work on a Debian install (non-arm)). Someone else can continue to troubleshoot this with hopes to find a real solution as I've run out of time today.

A temporary workaround is to use Python 3.8 instead (use the following 2 commands to install 3.8, then follow the rest of the guide for the rest)

CONFIGURE_OPTS=--enable-optimizations pyenv install 3.8.12 -v
pyenv global 3.8.12
turtlenator0316 commented 3 years ago

Ok, I'll let my Pi download/install it over dinner and will get back with a result asap. Thank you for the help!

turtlenator0316 commented 3 years ago

Ok, I deleted Red's files to start over. Did 3.8.12. Now I'm getting this:

(redenv) pi@octopi:~ $ redbot-setup -bash: /home/pi/redenv/bin/redbot-setup: /home/pi/redenv/bin/python: bad interpreter: No such file or directory

turtlenator0316 commented 3 years ago

Deleted the wrong folder. Deleting the correct folder and then reinstalling with Python 3.8 instead of 3.9 worked nicely. Side note if this gets put in documentation: users need to use command 'python3.8' instead of 'python3.9' like in tutorial.