kha-white/manga-ocr

FIX: Troubleshooting for M1 MacOs users

danpaldev opened this issue · 5 comments

I own two MacBooks and I was able to install manga-ocr without any problems on the Intel One. However, in the Mac that has a M1 (ARM) processor, I was getting an error when running pip3 install manga-ocr. Reading the error message, I noticed that there was a dependency that was having problems with the ARM architecture, it was mecab-python3.

I searched for some issues on mecab's repository and it seems that several users with the same setup, a M1 Mac, were facing a similar issue. This happens because mecab-python3 doesn't have a wheel for ARM architectures, so users with a M1 processor must build that pip package by themselves. This sounds hard, but in practice is sooooo easy:

cd ~

pip3 download mecab-python3

tar xfv mecab-python3-1.0.5.tar.gz

cd mecab-python3-1.0.5    

brew install mecab

python3 setup.py build

python3 setup.py install

After this, you can run pip3 list to verify that mecab package is installed in your system.

Now, if you run pip3 install manga-ocr again, it will be installed as expected.

Hopefully you can add this workaround in the README, so any user that encounter this can fix it.

P.S. All of this was done using python 3.9.13 installed and managed by pyenv

Regards!!!!

Thanks! I linked this issue in readme.

I only did brew install mecab and manga-ocr (and mokuro) installed and worked just fine. Did I lose something here?

If it installed successfully and it works then you're fine. Maybe brew install mecab is sufficient, I don't have a Mac to check this

I can read my manga now thank you. 2 hours later lol

tar: Error opening archive: Failed to open 'mecab-python3-1.0.5.tar.gz'

EDIT: brew install mecab instead of tar xfv mecab-python3-1.0.5.tar.gz fixed it, and installing manga-ocr right after