mindee / doctr

docTR (Document Text Recognition) - a seamless, high-performing & accessible library for OCR-related tasks powered by Deep Learning.
https://mindee.github.io/doctr/
Apache License 2.0
3.66k stars 426 forks source link

Missing dependencies #1589

Closed sylvainkalache closed 4 months ago

sylvainkalache commented 4 months ago

Bug description

Hello team, when installing docTR on Ubuntu 22.04 for torch, I had to manually install libpango-1.0-0 and libpangoft2-1.0-0.

Code snippet to reproduce the bug

sudo apt-get update -y sudo apt install -y python3 sudo apt install -y python3-pip sudo apt install -y python3.10-venv python3 -m venv testing-Mindee-docTR sudo apt install -y libgl1-mesa-glx testing-Mindee-docTR/bin/pip3 install "python-doctr[torch]" git clone https://github.com/sylvainkalache/docTR cd docTR wget "https://media.istockphoto.com/id/889405434/vector/realistic-paper-shop-receipt-vector-cashier-bill-on-white-background.jpg?s=612x612&w=0&k=20&c=M2GxEKh9YJX2W3q76ugKW23JRVrm0aZ5ZwCZwUMBgAg=" -O receipt.jpeg ../testing-Mindee-docTR/bin/python3 testing-docTR.py

Error traceback


WeasyPrint could not import some external libraries. Please carefully follow the installation steps before reporting an issue: https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#installation https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#troubleshooting


Traceback (most recent call last): File "/home/ubuntu/docTR/testing-docTR.py", line 1, in from doctr.io import DocumentFile File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/doctr/init.py", line 1, in from . import io, models, datasets, transforms, utils File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/doctr/io/init.py", line 2, in from .html import * File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/doctr/io/html.py", line 8, in from weasyprint import HTML File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/weasyprint/init.py", line 419, in from .css import preprocess_stylesheet # noqa: I001, E402 File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/weasyprint/css/init.py", line 28, in from .computed_values import COMPUTER_FUNCTIONS File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/weasyprint/css/computed_values.py", line 9, in from ..text.ffi import ffi, pango, units_to_double File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 434, in pango = _dlopen( File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/weasyprint/text/ffi.py", line 420, in _dlopen return ffi.dlopen(names[0]) # pragma: no cover File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/cffi/api.py", line 150, in dlopen lib, function_cache = _make_ffi_library(self, name, flags) File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/cffi/api.py", line 832, in _make_ffi_library backendlib = _load_backend_lib(backend, libname, flags) File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/cffi/api.py", line 827, in _load_backend_lib raise OSError(msg) OSError: cannot load library 'pango-1.0-0': pango-1.0-0: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called 'pango-1.0-0'

Environment

Collecting environment information...

DocTR version: N/A TensorFlow version: N/A PyTorch version: N/A (torchvision N/A) OpenCV version: N/A OS: Ubuntu 22.04.4 LTS Python version: 3.10.12 Is CUDA available (TensorFlow): N/A Is CUDA available (PyTorch): N/A CUDA runtime version: Could not collect GPU models and configuration: Could not collect Nvidia driver version: Could not collect cuDNN version: Could not collect

Deep Learning backend

N/A

felixdittrich92 commented 4 months ago

Also related to weasyprint :)

yumikim381 commented 4 months ago

For me doing "apt install weasyprint" as in weasyprint installation guide helped to solve the problem : "https://doc.courtbouillon.org/weasyprint/stable/first_steps.html#installation"