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\io.py", line 117, in read_pdf
    **kwargs
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\handlers.py", line 172, in parse
    p, suppress_stdout=suppress_stdout, layout_kwargs=layout_kwargs
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\parsers\lattice.py", line 402, in extract_tables
    self._generate_image()
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\parsers\lattice.py", line 211, in _generate_image
    from ..ext.ghostscript import Ghostscript
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\ext\ghostscript\__init__.py", line 24, in <module>
    from . import _gsprint as gs
  File "C:\ProgramData\Anaconda3\envs\camelot\lib\site-packages\camelot\ext\ghostscript\_gsprint.py", 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?
bR

1 Like