From b0542b955e18dd5abe228eafa7bb39e3326a14ec Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Sun, 16 Jan 2022 09:23:52 -0500 Subject: [PATCH] build: Reverted `python-magic-bin` back to `python-magic`. Added special note for macOS users in README. --- README.md | 15 +++++++++++++-- requirements.txt | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3e02c2c..76e2ed4 100644 --- a/README.md +++ b/README.md @@ -225,12 +225,23 @@ Exception: Could not find opus library. Make sure it is installed. ``` You need to install the opus codec (not embedded in all system): `apt install libopus0` -3. If you have a large amount of music files (>1000), it may take some time for the bot to boot, since +3. MacOS Users may encounter the following error: +``` +ImportError: failed to find libmagic. Check your installation +``` +This is caused by missing `libmagic` binaries and can be solved by +```bash +brew install libmagic + +``` +One may also install `python-magic-bin` instead of `python-magic`. + +5. If you have a large amount of music files (>1000), it may take some time for the bot to boot, since it will build up the cache for the music library on booting. You may want to disable this auto-scanning by setting ``refresh_cache_on_startup=False`` in `[bot]` section and control the scanning manually by ``!rescan`` command and the *Rescan Files* button on the web interface. -4. Alpine Linux requires some extra dependencies during the installation (in order to compile Pillow): +6. Alpine Linux requires some extra dependencies during the installation (in order to compile Pillow): ``` python3-dev musl-lib libmagic jpeg-dev zlib-dev gcc ``` diff --git a/requirements.txt b/requirements.txt index 4dab8ca..c6f0904 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ flask yt-dlp -python-magic-bin +python-magic Pillow mutagen requests