-
Notifications
You must be signed in to change notification settings - Fork 361
RuntimeError: Please make sure that Ghostscript is installed #282
Description
Hello,
Trying to run a single line: (Python 2.7.15 under Pycharm)
import camelot
tables = camelot.read_pdf(inpFile)
Full Stack:
C:\Python27\python.exe "C:\Program Files\JetBrains\PyCharm 2018.2.2\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 51131 --file C:/Users/Rafi/Documents/re_FOCUS/StrataVAR/Python/testPDFTables.py
pydev debugger: process 8344 is connecting
Connected to pydev debugger (build 183.5429.31)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2018.2.2\helpers\pydev\pydevd.py", line 1741, in
main()
File "C:\Program Files\JetBrains\PyCharm 2018.2.2\helpers\pydev\pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm 2018.2.2\helpers\pydev\pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:/Users/Rafi/Documents/re_FOCUS/StrataVAR/Python/testPDFTables.py", line 24, in
tables = camelot.read_pdf(inpFile)
File "C:\Python27\lib\site-packages\camelot\io.py", line 106, in read_pdf
layout_kwargs=layout_kwargs, **kwargs)
File "C:\Python27\lib\site-packages\camelot\handlers.py", line 162, in parse
layout_kwargs=layout_kwargs)
File "C:\Python27\lib\site-packages\camelot\parsers\lattice.py", line 351, in extract_tables
self._generate_image()
File "C:\Python27\lib\site-packages\camelot\parsers\lattice.py", line 186, in generate_image
from ..ext.ghostscript import Ghostscript
File "C:\Python27\lib\site-packages\camelot\ext\ghostscript_init.py", line 24, in
from . import _gsprint as gs
File "C:\Python27\lib\site-packages\camelot\ext\ghostscript_gsprint.py", line 229, in
raise RuntimeError('Please make sure that Ghostscript is installed')
RuntimeError: Please make sure that Ghostscript is installed
Process finished with exit code 1
Windows-10-10.0.17763
('Python', '2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)]')
('NumPy', '1.16.1')
('OpenCV', '4.0.0')
('Camelot', '0.7.2')
Ghostscript 64 installed under Win10 64 bit:
C:\Users\Rafi>gswin64c.exe -version
GPL Ghostscript 9.26 (2018-11-20)
Copyright (C) 2018 Artifex Software, Inc. All rights reserved.
There is a path to C:\Program Files\gs\gs9.26\bin and to C:\Program Files\gs\gs9.26\bin.
Tracking the source of the Python exception, it seems that the code in __win32_finddll(): fails to find the Registry key.
Using Regedit, there is a key:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\9.26
with two entries
GS_DLL: C:\Program Files\gs\gs9.26\bin\gsdll64.dll
and
GS_LIB - C:\Program Files\gs\gs9.26\bin;C:\Program Files\gs\gs9.26\lib;C:\Program Files\gs\gs9.26\fonts
The statement QueryInfoKey(k1) returns (in _gsprint.py)
(0, 0, 131955508546095202L), thus range(0,0) is [] and the loop fails, so the function returns None.
Any suggestions?
Thanks,
--Rafi