Daniel.y commited on
Commit
740c69c
·
unverified ·
2 Parent(s): dd3a2e9 5979959

Merge pull request #1345 from zhudongwork/docx-dev

Browse files
lightrag/api/routers/document_routes.py CHANGED
@@ -499,7 +499,10 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool:
499
  content = result.document.export_to_markdown()
500
  else:
501
  if not pm.is_installed("python-docx"): # type: ignore
502
- pm.install("docx")
 
 
 
503
  from docx import Document # type: ignore
504
  from io import BytesIO
505
 
 
499
  content = result.document.export_to_markdown()
500
  else:
501
  if not pm.is_installed("python-docx"): # type: ignore
502
+ try:
503
+ pm.install("python-docx")
504
+ except Exception:
505
+ pm.install("docx")
506
  from docx import Document # type: ignore
507
  from io import BytesIO
508