Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python-camelot (Error: GhostscriptNotFound while it is installed)

I am trying to extract tabular data from pdf using camelot and I am getting the following error.

Code:

tables = camelot.read_pdf(file_name)

Error:

GhostscriptNotFound: Please make sure that Ghostscript is installed and available on the PATH environment variable

I have already installed Ghostscript and I have it available on the PATH environment variable.

Please find below version details:

  • Windows-10-10.0.17134-SP0
  • Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
  • NumPy 1.14.3
  • openCV 3.4.3
  • Camelot 0.3.2

Please help resolve this issue.

like image 988
Venkatesan R Avatar asked Nov 15 '18 12:11

Venkatesan R


4 Answers

I unistalled the 64bit and

  1. Install the 32bit version

  2. Add the following two paths on Windows Environment Variables:

    C:\Program Files(x86)\gs\gs9.26\bin

    C:\Program Files(x86)\gs\gs9.26\lib

and now it works

like image 59
Alessandra Avatar answered Nov 21 '22 00:11

Alessandra


Download Ghostscript from here https://www.ghostscript.com/download/gsdnld.html and add it to the path if required

like image 25
Syenix Avatar answered Nov 21 '22 00:11

Syenix


Adding both the "bin" and "lib" paths for Ghostscript to the PATH worked for me:

  • C:\Program Files\gs\gs9.26\bin
  • C:\Program Files\gs\gs9.26\lib
like image 6
chermanson Avatar answered Nov 20 '22 23:11

chermanson


For me using brew link -f --overwrite ghostscript solved the issue. I would recommend checking the suggested solutions on https://github.com/atlanhq/camelot/issues/282. That's where I also found my fix.

like image 2
AJoR Avatar answered Nov 21 '22 00:11

AJoR