Camelot & Ghostscript Python Package Problem in KNIME

I am trying to read a table from a PDF file using Camelot Package via Python node in KNIME. Whilst the code works very well in Jupyter notebook when using KNIME’s Python node it complaints that “Ghostscript” is not installed properly in the conda environment which KNIME points to.

The same conda environment is also used by Jupyter to run the code and it works quite well there. Its just that KNIME is not getting the visibility of Ghostscript despite it being installed in the environment.

Has any of you come across similar issues in the past? Any solutions you can advise?

The error I get is as follows:-

ERROR Python Source        4:1        Execute failed: Please make sure that Ghostscript is installed
Traceback (most recent call last):
File "<string>", line 6, in <module>
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\", line 117, in read_pdf
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\", line 172, in parse
    p, suppress_stdout=suppress_stdout, layout_kwargs=layout_kwargs
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\parsers\", line 402, in extract_tables
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\parsers\", line 211, in _generate_image
    from ..ext.ghostscript import Ghostscript
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\ext\ghostscript\", line 24, in <module>
    from . import _gsprint as gs
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\ext\ghostscript\", line 256, in <module>
    raise RuntimeError("Please make sure that Ghostscript is installed")
RuntimeError: Please make sure that Ghostscript is installed

You might want to try to reinstall the package or also use pip to install it instead of conda. Also have you tested on a second env?

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.