Files
Petr DlouhýandClaude Opus 5.5 3120e76277 Make ninja an optional dependency (only DBNet needs it)
Ninja is only used by torch.utils.cpp_extension.load() when the optional
DBNet detector JIT-compiles its deformable-convolution ops. The default
CRAFT detector never needs it, and nothing imports the `ninja` module.

Installing it unconditionally adds a top-level `ninja` module that
collides with other packages such as django-ninja.

Move it to a `dbnet` extra (`pip install "easyocr[dbnet]"`), document it
in the README, and keep the Dockerfile installing the extra so the image
behaves as before.

Fixes #937

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 23:16:49 +02:00

37 lines
1.1 KiB
Python

"""
End-to-End Multi-Lingual Optical Character Recognition (OCR) Solution
"""
from io import open
from setuptools import setup
with open('requirements.txt', encoding="utf-8-sig") as f:
requirements = f.readlines()
def readme():
with open('README.md', encoding="utf-8-sig") as f:
README = f.read()
return README
setup(
name='easyocr',
packages=['easyocr'],
include_package_data=True,
version='1.7.2',
install_requires=requirements,
extras_require={'dbnet': ['ninja']},
entry_points={"console_scripts": ["easyocr= easyocr.cli:main"]},
license='Apache License 2.0',
description='End-to-End Multi-Lingual Optical Character Recognition (OCR) Solution',
long_description=readme(),
long_description_content_type="text/markdown",
author='Rakpong Kittinaradorn',
author_email='r.kittinaradorn@gmail.com',
url='https://github.com/jaidedai/easyocr',
download_url='https://github.com/jaidedai/easyocr.git',
keywords=['ocr optical character recognition deep learning neural network'],
classifiers=[
'Development Status :: 5 - Production/Stable'
],
)