camelot-dev / camelot-dev/excalibur
OSError: dlopen(libgs.so, 6): image not found on macOS / homebrew
- Dominant language
- Python
- Stars
- 1.8k
- Forks
- 238
- PR merge metrics
- No merged PRs in 30d
Description
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
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 "", line 1, in
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
from . import _gsprint as gs
File "lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py", line 258, in
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?
Contributor guide
Research direction
Start with the installation instructions and the failing import in camelot/ext/ghostscript/_gsprint.py. Reproduce the macOS failure through camelot.read_pdf(...) and compare the installed Ghostscript setup with the library-loading path shown in the traceback. Done means the cause is identified and the installation guidance or integration behavior is updated accordingly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100