-
-
Notifications
You must be signed in to change notification settings - Fork 473
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
Doc enhancement: Note dependency on libgs.so (libgs.dylib on Mac) for ghostscript #193
Comments
Ghostscript has been a pain, I'm actively trying to look into possible ways it can be removed. Thanks for reporting this issue with so much detail! Would you like to start a PR to add the relevant note you mention? This file needs to be modified: https://github.com/camelot-dev/camelot/blob/master/docs/user/install-deps.rst |
Sure - little weak on my PR-fu, so let me take a peak. |
Thanks! The contributing docs should be able to help :) |
@jimhall But wouldn't that mean that Camelot shouldn't work at all when installed from conda-forge (along with ghostscript on which it has a recipe dependency)? Could this error (while trying to use the pip-installed version of Camelot with ghostscript from conda) be the result of a linking issue? |
Btw I didn't get any error while trying to reproduce this just now. These are the commands I ran:
I removed my system ghostscript (which removed a lot of other stuff) before running the above commands. I hope I didn't break my system 😅 |
Yes I believe based on my experiments that a conda-forge installed Ghostscript will not work with Camelot. The existing Camelot instructions state you can do a "conda install + homebrew Ghostscript" and Camelot will work. I agree with that combo - it works for me. "conda install + conda forge gs" will fail. Looking at the Anaconda website here, I click on the "files" tab and download the latest ghostscript archive here. Unpack it and there is no libgs included.
Ha! Some questions: what platform are you on? On Mac with Homebrew it is installed as According to Apple's Developer Docs here one of the default install locations is UNIX / Linux (which you look like you are using) will be When I do the conda-forge command (I just did your steps above (I did python 3.7, you do 3.8 so I tried your version choice)) I can confirm there is no libgs install off of $HOME/opt/ananconda3/envs. Last little bit: looking at $HOME/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py in the Traceback and using the REPL, I see the ghostscript code is doing the following:
I read the ctypes — A foreign function library for Python just now and I think I see the following test we could add to the doc and you could use to determine how your system is behaving:
That may be why it is working for you - you may have multiple versions of ghostscript libgs.so hanging around. This code snip above should sort out what libgs you are using. Remove what you think is the correct copy and run again to find an alternate binary. Shoot - I think I have "pull request the pull request" if you agree! 😆 JIM |
Sorry I should've spent more time reproducing this! You're correct, installing
I'm on Ubuntu 20.04 and I just removed the
Thank you for looking into
I didn't remove it after I found it (to reproduce the bug) as that was going to take away
You're correct! I checked the shared library dependencies for $ ldd /usr/bin/gs$ ldd /usr/bin/gs linux-vdso.so.1 (0x00007ffc065d0000) libgs.so.9 => /usr/lib/x86_64-linux-gnu/libgs.so.9 (0x00007efd6bada000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007efd6b8e8000) libtiff.so.5 => /usr/lib/x86_64-linux-gnu/libtiff.so.5 (0x00007efd6b867000) libcups.so.2 => /usr/lib/x86_64-linux-gnu/libcups.so.2 (0x00007efd6b7cc000) libijs-0.35.so => /usr/lib/x86_64-linux-gnu/libijs-0.35.so (0x00007efd6b7c4000) libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007efd6b78c000) libjbig2dec.so.0 => /usr/lib/x86_64-linux-gnu/libjbig2dec.so.0 (0x00007efd6b76d000) libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007efd6b6e8000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007efd6b6cc000) liblcms2.so.2 => /usr/lib/x86_64-linux-gnu/liblcms2.so.2 (0x00007efd6b671000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007efd6b522000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007efd6b51c000) libidn.so.11 => /lib/x86_64-linux-gnu/libidn.so.11 (0x00007efd6b4e5000) libpaper.so.1 => /usr/lib/x86_64-linux-gnu/libpaper.so.1 (0x00007efd6b4df000) libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007efd6b498000) libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007efd6b3d9000) libopenjp2.so.7 => /usr/lib/x86_64-linux-gnu/libopenjp2.so.7 (0x00007efd6b383000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007efd6b360000) /lib64/ld-linux-x86-64.so.2 (0x00007efd6ca7c000) libwebp.so.6 => /usr/lib/x86_64-linux-gnu/libwebp.so.6 (0x00007efd6b0f5000) libzstd.so.1 => /usr/lib/x86_64-linux-gnu/libzstd.so.1 (0x00007efd6b04c000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007efd6b023000) libjbig.so.0 => /usr/lib/x86_64-linux-gnu/libjbig.so.0 (0x00007efd6ae15000) libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007efd6adc8000) libavahi-common.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 (0x00007efd6adba000) libavahi-client.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 (0x00007efd6ada5000) libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007efd6abcf000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007efd6aba1000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007efd6ab98000) libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007efd6aabb000) libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007efd6aa88000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007efd6aa81000) libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007efd6aa72000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007efd6aa21000) libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007efd6a8eb000) libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007efd6a8ca000) libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007efd6a746000) libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007efd6a730000) libnettle.so.7 => /usr/lib/x86_64-linux-gnu/libnettle.so.7 (0x00007efd6a6f6000) libhogweed.so.5 => /usr/lib/x86_64-linux-gnu/libhogweed.so.5 (0x00007efd6a6be000) libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007efd6a63a000) libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007efd6a633000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007efd6a615000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007efd6a568000) libffi.so.7 => /usr/lib/x86_64-linux-gnu/libffi.so.7 (0x00007efd6a55c000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007efd6a551000) liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007efd6a530000) libgcrypt.so.20 => /usr/lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007efd6a410000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007efd6a3ed000) In contrast,
Their sizes are also in contrast, I'm guessing that
To reproduce the bug in a clean environment, I created a docker container from the latest
No
Turns out even
After installing
And after installing
It all worked fine:
I didn't quite get this, what do you mean? |
@jimhall Thank you for reporting this! I'm also trying to replace ghostscript as the default image conversion backend, but till that happens, I'll include the useful info to avoid this bug in the docs by merging your PR with some minor tweaks (I'll do that today!). Would you be interested in testing if I have Linux and macOS wheels for |
@jimhall Thank you for reporting this issue and the PR! Please reply to the questions above when you get time :) |
Sure - this seems to be the key.
This is a good find/conclusion: I did not consider static binaries. Pretty clear choice on the part of Anaconda!
Ah - I was thinking my submission was too complicated after I sorted out the ctypes suggestion and was due for a re-write. But you took care of that with your modification of my PR. 😁.
Sure I could test for Mac and Solaris.
I should have some feedback by the end of this week! |
👍
Thank you!
Thank you! I was able to build Windows wheels, these are the two approaches I tried: I'm thinking of going forward with the second one, but I'll first need to try installing that wheel on a fresh Windows instance and see if it works. Feedback welcome! |
I had this problem today. Solved creating an env in conda installing camelot at the sime time: |
The Camelot documentation highlights a dependency on Ghostscript and
adds a check
that confirms that the Ghostscript binary is installed. The key dependency for
Camelot to run successfully is on a working copy of the libgs library
(libgs.dylib for MacOS).
Specific ask: Would ask that a note be added to the documentation
that in addition to running the
gs
binary for version info, add a note thatstates you require a full distribution ghostscript that includes the libraries
and fonts.
Details:
I performed the following steps:
Using the conda Ghostscript was a mistake and the Camelot documentation
suggests using Homebrew toolchain. But I thought I would be
good with using the conda Ghostscript but when ran a test script I got the
following error:
Looking at the conda package for Ghostscript I determined it only delivered
the userland binaries and not the fonts and libraries. I have opened an
issue with conda packaging team and
asked that the binaries and fonts be delivered.
Workaround: Install Ghostscript using the Homebrew tool chain
Owners of Camelot may argue (rightfully) this is a case of "pilot error / not following the
docs". Just would suggest adding a note might prevent what looks like a
common pilot error situation (See here
and here. Homebrew dependency
is pretty heavy weight lift also (you need Xcode for Homebrew to work, so a
lot of stuff to download/configure to get going with Camelot).
Thanks for a great tool!
Environment
The text was updated successfully, but these errors were encountered: