Install & Compatibility
Where this runs
tested against v3.9.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.10
✕ build_error
3/4 runs
py 3.11
✕ build_error
3/4 runs
py 3.12
✕ build_error
3/4 runs
py 3.13
✕ build_error
2/4 runs
py 3.9
✕ build_error
3/4 runs
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RapidOCR
✓ from rapidocr import RapidOCR
LangRec, ModelType, OCRVersion
✓ from rapidocr import LangRec, ModelType, OCRVersion
Required for advanced model selection introduced in v3.4.0.
This quickstart initializes the RapidOCR engine, which automatically handles model downloads on the first execution. It then performs OCR on a sample image from a URL and prints the extracted text. For visualization, ensure OpenCV is installed (e.g., `pip install opencv-python`).
import os
from rapidocr import RapidOCR
# Initialize the OCR engine. This will automatically download models on first run.
# Ensure 'onnxruntime' or another backend is installed (e.g., pip install rapidocr onnxruntime)
engine = RapidOCR()
# Example image from a public URL
img_url = "https://www.modelscope.cn/models/RapidAI/RapidOCR/resolve/master/resources/test_files/ch_en_num.jpg"
# Process the image
result = engine(img_url)
# Print the extracted text results
for line in result:
# Each line typically contains bounding box, text, and confidence
if len(line) >= 2:
print(f"Text: {line[1]}")
# You can also visualize the results (requires OpenCV)
# result.vis("vis_result.jpg")
# print("Visualization saved to vis_result.jpg")
rapidocr --version
Upgrade
Version history
3.9.2latest on PyPI · released Jul 21, 2026
Audit
Dependencies
pythonrequiredRequired Python version
onnxruntimerequiredDefault and recommended inference backend for balanced performance.
onnxruntime-gpuoptionalFor NVIDIA CUDA-enabled GPU acceleration. Requires uninstalling onnxruntime (CPU version) first.
rapidocr_openvinooptionalAlternative inference backend for Intel hardware acceleration (CPUs, VPUs, iGPUs).
rapidocr_paddleoptionalAlternative inference backend for PaddlePaddle ecosystem compatibility.
rapidocr_pytorchoptionalAlternative inference backend for PyTorch research workflows.