VikParuchuri/marker

unsupported operand type(s) for |: '_GenericAlias' and 'NoneType'

YuChuanhui3 opened this issue · 3 comments

(marker) PS D:\pdf> python -V
Python 3.9.19
(marker) PS D:\pdf> python
Python 3.9.19 (main, May  6 2024, 20:12:36) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'2.4.0+cpu'
>>> exit()
(marker) PS D:\pdf> marker ./ ./
Traceback (most recent call last):
  File "C:\Users\16554\.conda\envs\marker\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\16554\.conda\envs\marker\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\16554\.conda\envs\marker\Scripts\marker.exe\__main__.py", line 4, in <module>
  File "C:\Users\16554\.conda\envs\marker\lib\site-packages\convert.py", line 13, in <module>
    from marker.convert import convert_single_pdf
  File "C:\Users\16554\.conda\envs\marker\lib\site-packages\marker\convert.py", line 12, in <module>
    from marker.tables.table import format_tables
  File "C:\Users\16554\.conda\envs\marker\lib\site-packages\marker\tables\table.py", line 3, in <module>
    from marker.schema.page import Page
  File "C:\Users\16554\.conda\envs\marker\lib\site-packages\marker\schema\page.py", line 6, in <module>
    from surya.schema import TextDetectionResult, LayoutResult, OrderResult
  File "C:\Users\16554\.conda\envs\marker\lib\site-packages\surya\schema.py", line 141, in <module>
    class OCRResult(BaseModel):
  File "C:\Users\16554\.conda\envs\marker\lib\site-packages\surya\schema.py", line 143, in OCRResult
    languages: List[str] | None = None
TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType'

acandon 环境下报错:

Upgrading my environment to Python 3.10 did the trick! I hope it helps you.

Upgrading my environment to Python 3.10 did the trick! I hope it helps you.

Thank you very much, the issue has been resolved