To convert an image to a PDF document using the PaddleOCR library in Python Create a virtual environment : python3 -m venv myenv Activate the virtual environment macos version: Run source myenv/bin/activate Install pdfkit in virtual environment : pip install pdfkit Install opencv in virtual environment : pip install opencv-python Install PaddlePaddle : link : https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/doc/doc_en/quickstart_en.md#11-install-paddlepaddle