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

Errors while importing ParsingExceptions from megaparse.exceptions.base #217

Open
bryanhughes opened this issue Jan 10, 2025 · 4 comments
Open

Comments

@bryanhughes
Copy link

Just loading my module is producing all these issues:

--- Logging error ---
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/[email protected]/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 687, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.11.11/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 377, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: not all arguments converted during string formatting
Call stack:
  File "/Users/bryan/Applications/PyCharm Professional Edition.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 2270, in <module>
    main()
  File "/Users/bryan/Applications/PyCharm Professional Edition.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 2252, in main
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/Users/bryan/Applications/PyCharm Professional Edition.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1563, in run
    return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
  File "/Users/bryan/Applications/PyCharm Professional Edition.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py", line 1587, in _exec
    runpy._run_module_as_main(module_name, alter_argv=False)
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/Users/bryan/dev/git/vialab/backend/janet/crawler/__main__.py", line 20, in <module>
    from megaparse.exceptions.base import ParsingException
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/bryan/dev/git/vialab/backend/venv/lib/python3.11/site-packages/megaparse/__init__.py", line 1, in <module>
    from .megaparse import MegaParse
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/bryan/dev/git/vialab/backend/venv/lib/python3.11/site-packages/megaparse/megaparse.py", line 20, in <module>
    class MegaParse:
  File "/Users/bryan/dev/git/vialab/backend/venv/lib/python3.11/site-packages/megaparse/megaparse.py", line 24, in MegaParse
    ocr_parser: BaseParser = DoctrParser(),
  File "/Users/bryan/dev/git/vialab/backend/venv/lib/python3.11/site-packages/megaparse/parser/doctr_parser.py", line 29, in __init__
    providers = self._get_providers()
  File "/Users/bryan/dev/git/vialab/backend/venv/lib/python3.11/site-packages/megaparse/parser/doctr_parser.py", line 51, in _get_providers
    logger.info("Available providers:", prov)
Message: 'Available providers:'
Arguments: (['CoreMLExecutionProvider', 'AzureExecutionProvider', 'CPUExecutionProvider'],)
Using downloaded & verified file: /Users/bryan/.cache/onnxtr/models/db_resnet50-69ba0015.onnx
Using downloaded & verified file: /Users/bryan/.cache/onnxtr/models/crnn_vgg16_bn-662979cc.onnx
image
@bryanhughes bryanhughes changed the title Errors while ParsingExceptions from megaparse.exceptions.base Errors while importing ParsingExceptions from megaparse.exceptions.base Jan 10, 2025
@chloedia
Copy link
Collaborator

chloedia commented Jan 13, 2025

Hi Bryan, Thank you for creating this issue, I found the reason why and solved it in #218 which will be merged and released soon !

@bryanhughes
Copy link
Author

bryanhughes commented Jan 13, 2025 via email

@chloedia
Copy link
Collaborator

No worries, it is a logging error, I fixed it in the new PR and it should be solved in the next release (end of the week). In the meantime you can just remove logger.info("Available providers:", prov) in doctr_parser.py file in the lib folder :)

@bryanhughes
Copy link
Author

bryanhughes commented Jan 13, 2025 via email

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

No branches or pull requests

2 participants