markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

PdfConverter threw TypeError with message: safe_rgb()

Open YehorI opened this issue 9 months ago • 1 comments

Презент_1.pdf

❯ uv run markitdown "/home/yehori/Documents/Projects/NEO/Обучение_экология/Презент_1.pdf" -o /home/yehori/Documents/Projects/NEO/Обучение_экология/1_1.md
Traceback (most recent call last):
  File "/home/yehori/Documents/etc/mid/.venv/bin/markitdown", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/yehori/Documents/etc/mid/.venv/lib/python3.13/site-packages/markitdown/__main__.py", line 197, in main
    result = markitdown.convert(
        args.filename, stream_info=stream_info, keep_data_uris=args.keep_data_uris
    )
  File "/home/yehori/Documents/etc/mid/.venv/lib/python3.13/site-packages/markitdown/_markitdown.py", line 260, in convert
    return self.convert_local(source, stream_info=stream_info, **kwargs)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yehori/Documents/etc/mid/.venv/lib/python3.13/site-packages/markitdown/_markitdown.py", line 314, in convert_local
    return self._convert(file_stream=fh, stream_info_guesses=guesses, **kwargs)
           ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yehori/Documents/etc/mid/.venv/lib/python3.13/site-packages/markitdown/_markitdown.py", line 600, in _convert
    raise FileConversionException(attempts=failed_attempts)
markitdown._exceptions.FileConversionException: File conversion failed after 1 attempts:
 - PdfConverter threw TypeError with message: safe_rgb() missing 2 required positional arguments: 'g' and 'b'

YehorI avatar Apr 29 '25 06:04 YehorI

A temporary solution:

pip install pdfminer.six==20250324

from

https://github.com/opendatalab/MinerU/issues/2400

guanguan-w avatar Apr 29 '25 12:04 guanguan-w