excalibur
excalibur copied to clipboard
OSError: dlopen(libgs.so, 6): image not found on macOS / homebrew
I followed in installation instructions but getting this:
>>> tables = camelot.read_pdf(...pdf')
Traceback (most recent call last):
File "lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py", line 251, in <module>
libgs = cdll.LoadLibrary("libgs.so")
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 434, in LoadLibrary
return self._dlltype(name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libgs.so, 6): image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "lib/python3.7/site-packages/camelot/io.py", line 117, in read_pdf
**kwargs
File "lib/python3.7/site-packages/camelot/handlers.py", line 172, in parse
p, suppress_stdout=suppress_stdout, layout_kwargs=layout_kwargs
File "lib/python3.7/site-packages/camelot/parsers/lattice.py", line 403, in extract_tables
self._generate_image()
File "lib/python3.7/site-packages/camelot/parsers/lattice.py", line 212, in _generate_image
from ..ext.ghostscript import Ghostscript
File "lib/python3.7/site-packages/camelot/ext/ghostscript/__init__.py", line 24, in <module>
from . import _gsprint as gs
File "lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py", line 258, in <module>
raise RuntimeError("Please make sure that Ghostscript is installed")
RuntimeError: Please make sure that Ghostscript is installed
Version information:
macOS Mojave 10.14.6
$ brew --version
Homebrew 2.2.5
Homebrew/homebrew-core (git revision 970e0; last commit 2020-02-04)
$ brew info ghostscript
ghostscript: stable 9.50 (bottled), HEAD
Interpreter for PostScript and PDF
https://www.ghostscript.com/
/usr/local/Cellar/ghostscript/9.50 (670 files, 82.3MB) *
Poured from bottle on 2020-02-05 at 07:21:21
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ghostscript.rb
==> Dependencies
Build: pkg-config ✘
Required: libtiff ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 20,809 (30 days), 61,515 (90 days), 280,685 (365 days)
install-on-request: 10,344 (30 days), 28,532 (90 days), 116,038 (365 days)
build-error: 0 (30 days)
What's likely to be the problem here?