Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'ghostscript', but ghostscript installed #14

Open
halloleo opened this issue Mar 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@halloleo
Copy link

When doing a lattice conversion I get the following error:

  File "/my/venv/path/lib/python3.8/site-packages/camelot/backends/ghostscript_backend.py", line 34, in convert
    import ghostscript
ModuleNotFoundError: No module named 'ghostscript'

Steps to reproduce the bug

Steps used to install camelot

  1. brew install ghostscript
  2. git clone https://github.com/py-pdf/pypdf_table_extraction.git
  3. pip install ".[base]"
  4. pip install opencv-python

Steps to be used to reproduce behavior:

  1. Run
    camelot -f csv -o out.csv lattice in.pdf

Expected behavior

A atble in out.csv
Environment

  • OS: [e.g. macOS] macOS Sonoma
  • Python version: 3.8.18
  • Camelot version: pypdf-table-extraction repo from 20 Mar 2024

Additional context

I checked in the Python REPL of the pypdf-table-extraction venv:

>>> from ctypes.util import find_library
>>> find_library("gs")
'/opt/homebrew/lib/libgs.dylib'

but

>>> import ghostscript
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'ghostscript'
@halloleo halloleo added the bug Something isn't working label Mar 20, 2024
@foarsitter
Copy link
Collaborator

foarsitter commented Mar 20, 2024

pip install ghostscript will do the trick. [tool.poetry.group.*.dependencies] are not compatible with pip extras for what I known.

@halloleo
Copy link
Author

This worked. thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants