Prerequisites
Before you run the Optical Character Recognition tool, import the following supported Python external libraries from the PIL package into the directory where your Secure Agent is installed:
- •json
- •pytesseract
- •fitz
- •image
To install the required libraries, install Tesseract, and then install the unstructured libraries.
Step 1. Install Tesseract
You can install Tesseract on different operating systems.
For example, to install Tesseract on Ubuntu/Debian, run the following commands:
sudo apt update
sudo apt-get install tesseract-ocr
To install Tesseract on Fedora, run the following command:
sudo dnf install tesseract
Step 2. Install the unstructured libraries
- 1Run the following command to navigate to the following Secure Agent directory on your machine:
cd <Secure Agent installation directory/apps/AIAgentRuntime
- 2Run the following command once to install the unstructured library with OCR support:
./<Latest AI Agent Runtime service version>/pythonRuntime/python/bin/pip3.13 install unstructured[<file extension>] --target data/external-libs/
For example, to install the pytesseract, PyMuPDF, and Pillow libraries, run the following command:
./<Latest AI Agent Runtime service version>/pythonRuntime/python/bin/pip3.13 install --target=/root/infaagent/apps/AIAgentRuntime/data/external-libs/ pytesseract PyMuPDF Pillow