import shutil
import sys
def check_tesseract():
"""Check if Tesseract-OCR is installed and accessible in the system PATH."""
tesseract_path = shutil.which("tesseract")
if tesseract_path:
print(f"✅ Tesseract found at: {tesseract_path}")
return True
else:
print("❌ Tesseract-OCR not found in PATH.")
print("To use OCR features, please install Tesseract:")
print(" - macOS: brew install tesseract tesseract-lang")
print(" - Ubuntu: sudo apt-get install tesseract-ocr tesseract-ocr-kor")
print(" - Windows: Download installer and select 'Korean' in language options")
return False
def check_environment():
"""Run all environment checks."""
print("Checking environment...")
tesseract_ok = check_tesseract()
if tesseract_ok:
print("\nAll checks passed. You are ready to go!")
return True
else:
print("\nSome checks failed. See above for details.")
return False
if __name__ == "__main__":
success = check_environment()
sys.exit(0 if success else 1)