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.31k stars 397 forks source link

Missing depency libGL #1590

Closed sylvainkalache closed 1 month ago

sylvainkalache commented 1 month ago

Bug description

Hello team, when installing docTR on Ubuntu 22.04 for torch, I had to manually install libgl1-mesa-glx

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-get install -y libpango-1.0-0 libpangoft2-1.0-0 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

Traceback (most recent call last): File "/home/ubuntu/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 1, in from .elements import File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/doctr/io/elements.py", line 19, in from doctr.utils.common_types import BoundingBox File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/doctr/utils/init.py", line 3, in from .geometry import File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/doctr/utils/geometry.py", line 10, in import cv2 File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/cv2/init.py", line 181, in bootstrap() File "/home/ubuntu/testing-Mindee-docTR/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: libGL.so.1: cannot open shared object file: No such file or directory

Environment

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 1 month ago

Hi @sylvainkalache :wave:,

Thanks for reporting :+1: This is already solved we moved weasyprint to optional dependencies because it's only used for .from_url so it will be available with the next release :)

PS: We can't include any OS depending packages into the project

Related: #1052