-
Notifications
You must be signed in to change notification settings - Fork 359
RuntimeError: Please make sure that Ghostscript is installed #282
Comments
Did you try the solutions mentioned in #184? |
Hello Vinayak, Any suggestions? |
I'm having a similar issue, and couldn't solve it using the solutions mentioned in #184. I'd appreciate any suggestions. Environment I'm using the foo.pdf from the documentation.
And getting the error message:
|
I have the same issue with the standalone version of Ghostscript (install version is not allowed due to the IT policy in my company). I had set the bin and lib directories of the Ghostscript (standalone) in PATH but Camelot is still trying to find the Ghostscript from the Windows registry. |
In macos |
In my case, Ghostscript is successfully installed. Shouldn't this be a bug? |
Ghostscript is successfully installed. Shouldn't this be a bug? yes it is a bug!!!!! |
I'll look into this over the weekend. |
exact same issue as well. I have the same issue with the standalone version of Ghostscript (install version is not allowed due to the IT policy in my company). I had set the bin and lib directories of the Ghostscript (standalone) in PATH but Camelot is still trying to find the Ghostscript from the Windows registry. |
I currently don't have a Windows machine to reproduce this, let me install it on my current laptop. I believe we should just try to get rid of ghostscript with #96. |
Same issue here |
Same for me. Even if i install ghostscript and python3-ghostscript via pip. |
Had the same Issue on Windows. I just installed Ghostscript installer from this Website: https://www.ghostscript.com/download/gsdnld.html My Code is now having no issues. |
My code is now having no issues, too, thank you |
I have the same issue. Although I've tried other install method to install ghost script, it still does not work... OSError Traceback (most recent call last) ~/anaconda3/lib/python3.7/ctypes/init.py in LoadLibrary(self, name) ~/anaconda3/lib/python3.7/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error) OSError: dlopen(libgs.so, 6): image not found During handling of the above exception, another exception occurred: RuntimeError Traceback (most recent call last) ~/anaconda3/lib/python3.7/site-packages/camelot/io.py in read_pdf(filepath, pages, password, flavor, suppress_stdout, layout_kwargs, **kwargs) ~/anaconda3/lib/python3.7/site-packages/camelot/handlers.py in parse(self, flavor, suppress_stdout, layout_kwargs, **kwargs) ~/anaconda3/lib/python3.7/site-packages/camelot/parsers/lattice.py in extract_tables(self, filename, suppress_stdout, layout_kwargs) ~/anaconda3/lib/python3.7/site-packages/camelot/parsers/lattice.py in _generate_image(self) ~/anaconda3/lib/python3.7/site-packages/camelot/ext/ghostscript/init.py in ~/anaconda3/lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py in RuntimeError: Please make sure that Ghostscript is installed |
macOS - |
Hi this error also exists for me. |
I was investigating this code earlier and I noticed for my macOS implementation that it's having some issue with the conditional of libgs.so file which produces the runtime error. I tried working on both virtualenv and conda but I also suspect that the find_library cdll is not working in it somewhere. It does not detect the GhostScript even when I installed from source and did a |
This did the trick for me too. |
I also tried, its working perfectly fine..just after installation |
This worked for me too. |
Yes, on windows 10 it works after installing the ghostscript exe at: https://www.ghostscript.com/download/gsdnld.html |
I had had this issue on aws elasticbeanstalk in a django app while reading a pdf : |
|
Some hack: Looking at sources: camelot/camelot/ext/ghostscript/_gsprint.py Line 223 in 9137df2
My guess is that downloading : https://www.ghostscript.com/download/gsdnld.html For ones who cannot add HKEY_LOCAL_MACHINE, add it to HKEY_CURRENT_USER\Software\key_name\GS_DLL\GS_DLL Choose Also import HKEY_CURRENT_USER here camelot/camelot/ext/ghostscript/_gsprint.py Line 192 in 9137df2
and here: camelot/camelot/ext/ghostscript/_gsprint.py Line 201 in 9137df2
|
MacOS, had the same error after running Running |
"errorMessage": "Please make sure that Ghostscript is installed", getting this error while run the code using lambda function aws. Already camelot and ghostscript added as a dependency. I need to resolve as soon as possible. Please help. my code is : def pdfToJson(event=None,context=None): Note:Locally it is working properly. #serverless #awslambda #python #camelot #ghostscript |
And more thing how to add ghostscript dependencies for lambda function python? |
This resolved my issue too |
Same issue. Is there a way I can fix this with out modifying the code? The solutions above don't work if you are dependent on a requirements.in file for containerizing. |
Same issue. I tried: "brew install ghostscript" and it said that my ghostscript was installed but not linked, so I fixed with: sudo chown -R Worked perfectly with my MacOs |
I would recommend to install GhostScript via Chocolatey for Windows OS.
I had this same problem. If you happen to have choco installed in your system. |
Can you try installing the latest version with
More info in the docs here: https://camelot-py.readthedocs.io/en/master/user/advanced.html#use-alternate-image-conversion-backends Please report issues here: https://github.com/camelot-dev/camelot/issues |
@rafiepstein Please close this issue If your problem is solved. |
If it is Windows 10 OS, add direction to the Ghostscript into the environment-variables system-paths (PATH): |
I also had the same issue in Ubuntu. I had to run |
Yes, but it is just reinstalling and a useless reboot. Problem lies somewhere else. When I copy gs and all the related binaries (I cache them in a workflow) to the appropriate paths, |
Any updates on this? I have the same problem on my Mac M1 Big Sur. Tried:
This finds the library 👇
This not 👇
The link |
//Edit// It finally runs. I did this: Install Ghostscript:
Create System links (change version and path based on your system)
Then checkout camelot version from github:
Open github folder in terminal and switch branch:
Replace ctypes with distutils based on this pull-requests:
Then create your virtual environment or install it globally:
When everything run smoothly, try to use camelot. For me, I got an error like |
Instead of all that, you could install v0.10.x on <= Python 3.9.x, which removes dependency on ghostscript by adding a |
In case this helps anyone, I was encountering this on Mac M1 running mac OS Big Sur. I had installed ghostscript with I was able to resolve by adding |
This is how I solved for this problem on a Windows computer: Went to File Explorer -> C drive -> Program Files -> gs -> gs9.55.0 -> shift-clicked on bin folder -> copied as path ("C:\Program Files\gs\gs9.55.0\bin") import ctypes The output was "C:\Program Files\gs\gs9.55.0\bin\gsdll64.dll" which means the solution worked. I was then able to install and use Camelot with no problems. And I heard that this solution works on a Mac: https://jsoma.github.io/m1-install-fixes/python/ghostscript/ |
On a M1 Mac with macOS Monterey, after
and
|
fwiw, the following worked for me while using pipenv on MacOS. Install dependencies from the command-line:
Add packages to PipFile, including, e.g., matplotlib "extra":
Use pipenv shell to run camelot CLI:
Perhaps due to pipenv, it was not enough to install ghostscript, et al in the system. I needed the python packages for opencv-python and ghostscript. The best way to manage system library dependencies with pipenv is unclear. Good luck - |
you may use this link to properly install ghostscript on win10.. works fine with me now. https://blog.finxter.com/the-ultimate-guide-to-installing-ghostscript/ |
This worked for me. I had to |
Hey, that's mine! And I have a new improved suggestion to solve this for OS X! Three little baby lines of code to solve all your problems: brew install ghostscript # You probably did this already
mkdir -p ~/lib
ln -s "$(brew --prefix gs)/lib/libgs.dylib" ~/lib I put together a long writeup about why it works, but the basics:
|
|
This worked for me, currently on Apple M1 |
Perfect, works for me |
This works for me! OS: MacOS Monterey 12.6.1
|
I had the same problem. When running I am using MacOS. Following solutions didn't work for me:
I haven't tried to install it with conda since I'm not using conda anyway. I had to follow the steps below to solve the issue:
After following these steps I could successfully use camelot. |
On M2 Mac this worked -
|
For Co-Lab |
Hey all! We try to build a maintained fork at pypdf_table_extraction. You are welcome to check it out and contribute there. |
On m1 mac the following worked for me
|
Hello,
Trying to run a single line: (Python 2.7.15 under Pycharm)
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
The text was updated successfully, but these errors were encountered: