Build a Custom rapidocr Wheel
RapidOCR uses pyproject.toml and setuptools-scm to build wheels. The build environment requires Python >=3.9; the resulting wheel supports Python >=3.8.
1. Enter the Python package directory¶
2. Install build dependencies¶
python -m pip install --upgrade pip
python -m pip install build setuptools wheel setuptools-scm PyYAML
Install the complete requirements if you also need to run tests:
3. Prepare bundled model assets¶
This command resolves the default Det, Cls and Rec models, verifies their SHA256 checksums and generates MANIFEST.in. To verify already prepared assets without downloading them:
4. Set the version and build¶
The wheel is written to dist/, for example:
5. Verify the wheel¶
Check its version:
Check that the default models are included:
Alternatively, build from a Git tag. When the current commit is exactly at v3.1.0, setuptools-scm derives version 3.1.0; otherwise it generates a development version.