2

I'm trying to use camelot to read tables from a pdf, but when I execute tables = camelot.read_pdf('foo.pdf') I get the following error:

RuntimeError: Please make sure that Ghostscript is installed

I have installed ghostcript and python-ghostscript and some previuos versions. I have also try with pipenv install "camelot-py[base]" and camelot-py, but I still get the same error.

KenS
  • 30,202
  • 3
  • 34
  • 51
Daniel
  • 51
  • 1
  • 6
  • 2
    Is `ghostscript` available in your `$PATH`? That is, if you type `gs`, does it start or do you get an error? – larsks Jun 09 '22 at 10:15

1 Answers1

0

I assume that your platform is Windows, because it's not needed to do on MacOs.

And for Windows, you still need to tell python/camelot where to find Ghostscript, after installing Ghostscript. To do so, it is necessary to set adapt your system’s Path variable:

  • Go to Control Panel → System and Security → System → Advanced System Settings → computer name, domain and workgroup settings → Advanced → Environment Variables
  • Find the Path variable within System Variables, select it, and click on edit.
  • Add C:\Program Files\gs\gs9.23\bin (or the directory where you installed Ghostscript) to the Path variable.

In Windows 10, you can do this by clicking on New and entering the path. In other Windows versions, append the path to the variable value, separated by a semicolon.

Said Akyuz
  • 180
  • 1
  • 1
  • 11