Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system dependencies required by RapidOCR to fix Khoj Docker image #842

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

kxnarak
Copy link
Contributor

@kxnarak kxnarak commented Jul 8, 2024

Issue

The Khoj docker build would fail with ImportError: libGL.so.1: cannot open shared object file: No such file or directory. This was required by the Khoj RapidOCR python package dependency.

Stacktrace
khoj-server-1    | Traceback (most recent call last):
khoj-server-1    |   File "/app/src/khoj/main.py", line 93, in <module>
khoj-server-1    |     from khoj.configure import configure_routes, initialize_server, configure_middleware
khoj-server-1    |   File "/app/src/khoj/configure.py", line 40, in <module>
khoj-server-1    |     from khoj.routers.indexer import configure_content, configure_search
khoj-server-1    |   File "/app/src/khoj/routers/indexer.py", line 12, in <module>
khoj-server-1    |     from khoj.processor.content.images.image_to_entries import ImageToEntries
khoj-server-1    |   File "/app/src/khoj/processor/content/images/image_to_entries.py", line 7, in <module>
khoj-server-1    |     from rapidocr_onnxruntime import RapidOCR
khoj-server-1    |   File "/usr/local/lib/python3.10/dist-packages/rapidocr_onnxruntime/__init__.py", line 4, in <module>
khoj-server-1    |     from .main import RapidOCR
khoj-server-1    |   File "/usr/local/lib/python3.10/dist-packages/rapidocr_onnxruntime/main.py", line 8, in <module>
khoj-server-1    |     import cv2
khoj-server-1    |   File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 181, in <module>
khoj-server-1    |     bootstrap()
khoj-server-1    |   File "/usr/local/lib/python3.10/dist-packages/cv2/__init__.py", line 153, in bootstrap
khoj-server-1    |     native_module = importlib.import_module("cv2")
khoj-server-1    |   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
khoj-server-1    |     return _bootstrap._gcd_import(name[level:], package, level)
khoj-server-1    | ImportError: libGL.so.1: cannot open shared object file: No such file or directory
khoj-server-1 exited with code 1

Fix

A minimal set of system packages have been added to resolve this issue.

@debanjum
Copy link
Member

debanjum commented Jul 8, 2024

Thanks for fixing the Khoj docker build! Verified these changes fix the LibGL system dependency missing error required by rapidOCR

@debanjum debanjum changed the title add dependencies required by the RapidOCR python package Add system dependencies required by RapidOCR to fix Khoj Docker image Jul 8, 2024
@debanjum debanjum added the fix Fix something that isn't working as expected label Jul 8, 2024
@debanjum debanjum merged commit 0b1b262 into khoj-ai:master Jul 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fix something that isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants