1

Getting an error with Camelot, "Ghostscript is not installed".

Tried everything, the issue is that it is not added to path, gs IS installed on the machine.

Failing the following check from Camelot install page https://camelot-py.readthedocs.io/en/master/user/install-deps.html...

For Ghostscript Open the Python REPL and run the following:

For Ubuntu/MacOS:

from ctypes.util import find_library
find_library("gs")
"libgs.so.9"

Check: The output of the find_library function should not be empty.

If the output is empty, then it’s possible that the Ghostscript library is not available one of the LD_LIBRARY_PATH/DYLD_LIBRARY_PATH/PATH variables depending on your operating system. In this case, you may have to modify one of those path variables.

...

The output is returning empty.

So that is the issue, needs to be added to these paths, I have no idea how to do it.

Step by step instructions would be fantastic.

as above as above as

KenS
  • 30,202
  • 3
  • 34
  • 51
Dmul
  • 11
  • 2
  • 1
    Does this answer your question? [How to set the environmental variable LD\_LIBRARY\_PATH in linux](https://stackoverflow.com/questions/13428910/how-to-set-the-environmental-variable-ld-library-path-in-linux) – Brian61354270 Feb 08 '23 at 21:16
  • raises more questions for me unfortunately... I tried alot of the answers there and still no joy – Dmul Feb 09 '23 at 21:42

1 Answers1

0

I don't know that package that you are using, nor do I know how you installed ghostscript so we'll have to go from first principles.

You need to:

  • find libgs.dylib, then
  • tell your tools where it is by setting DYLD_LIBRARY_PATH

You should be able to find the ghostscript library with this command:

find /usr /opt -name "libgs.dylib"

If that doesn't find it, try harder with:

find /usr /opt -name "libgs.dylib.*"

And if that doesn't find it, try even harder with:

find / -name "libgs.dylib.*" 2> /dev/null

Once you have found it, it might look something like:

/opt/homebrew/bin/libgs.dylib

Now you need to strip off everything from the rightmost slash onwards. In this example that leaves:

/opt/homebrew/bin

Now you need to add that to your path like this:

export DYLD_LIBRARY_PATH=DYLD_LIBRARY_PATH:/opt/homebrew/bin

Then run the Python REPL stuff per your original instructions.

Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
  • Thanks for your response. I am setting this PATH using; sudo nano ~/.bash_profile is this the correct place to set this path? it is not working for me – Dmul Feb 09 '23 at 21:32
  • No, that's not correct at all. I didn't mention either `sudo` or `~/.bash_profile` or `PATH`. – Mark Setchell Feb 09 '23 at 22:03
  • Oh ok... regardless, I actually managed to set the path, by setting the path in ~/.bashrc, and then using source ~/.bashrc .... managed to get a response to the above check. Unfortunately I am still getting the same "ghostscript not installed" error from camelot, even after reinstalling camelot and rebooting the machine – Dmul Feb 09 '23 at 22:29
  • Did you run the `find` command I suggested? What did you find as a result? Then what did you do with the result? – Mark Setchell Feb 09 '23 at 22:36
  • Yeah and I found the path. As above, I successfully added the path, getting an output to the test. Camelot is still throwing an error, "Ghostscript is not installed" – Dmul Feb 10 '23 at 17:33
  • Ok, now you need to find where your `ghostscript` is installed so run `ls -l /opt/homebrew/bin/gs` to see if it is there. If it is, do `export PATH=$PATH:/opt/homebrew/bin` and try Camelot again. – Mark Setchell Feb 10 '23 at 17:42