Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
YuChuanhui3 opened this issue Aug 22, 2024 · 2 comments · May be fixed by #278
Open

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

YuChuanhui3 opened this issue Aug 22, 2024 · 2 comments · May be fixed by #278

Comments

@YuChuanhui3
Copy link

(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 环境下报错:

@GLambard
Copy link

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

@YuChuanhui3
Copy link
Author

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

Thank you very much, the issue has been resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants