tesserocr
tesserocr copied to clipboard
ImportError: dlopen
Seeing the following issue on a MacBook M2 Max:
ImportError: dlopen(/Users/mhluska/project/env/lib/python3.11/site-packages/tesserocr.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '__ZN9tesseract11TessBaseAPID1Ev'
Python version 3.11.4
Using venv with tesserocr 2.6.0
Tesseract version 5.3.2
You are using tesserocr build against different version of tesseract.
How would I fix the issue? I've tried reinstalling both tesseract and tesserocr. Do I need a specific version of tesseract with this version of tesserocr?
I managed to get it working by installing older versions:
Install tesseract 5.3.1-1 specifically (last known working version):
curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/8bedbf36570ebcbae090227aed6048f7e08f1c76/Formula/tesseract.rb
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install tesseract.rb
rm tesseract.rb
Install tesserocr v2.6.0:
pip uninstall tesserocr
pip install --no-cache-dir tesserocr==2.6.0
It would be nice to know how to avoid having to do this though.
Try to install tesserocr from source instead of pip... (not sure about Mac/brew, but e.g. on Linux you will need the Tesseract and Leptonica dev packages)