Repository: Cog-Creators/Red-DiscordBot

Issue:
Can't load audio cog on Linux
### 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 "<frozen importlib._bootstrap>", line 1030, in _gcd_import
Sep 13 04:46:39 octopi python[1244]:   File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
Sep 13 04:46:39 octopi python[1244]:   File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
Sep 13 04:46:39 octopi python[1244]:   File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
Sep 13 04:46:39 octopi python[1244]:   File "<frozen importlib._bootstrap_external>", line 850, in exec_module
Sep 13 04:46:39 octopi python[1244]:   File "<frozen importlib._bootstrap>", 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 <module>
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 <module>
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 <module>
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 <module>
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.


Discussion:
I would highly recommend you to update your bot before doing any other troubleshooting. 3.4.5 is really oudated.
> 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
Please join us on Discord at discord.gg/red so we can assist in troubleshooting your issue
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.
> 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)
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
```
Ok, I'll let my Pi download/install it over dinner and will get back with a result asap. Thank you for the help!
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`
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.

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -86,7 +86,13 @@
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
 # This patterns also effect to html_static_path and html_extra_path
-exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
+exclude_patterns = [
+    "_build",
+    "Thumbs.db",
+    ".DS_Store",
+    # to ensure that include files (partial pages) aren't built, exclude them
+    "**/_includes/**",
+]
 
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = "sphinx"


Test patch: