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

Request that libgs.so or libgs.dylib (MacOS) be delivered in conda-forge Ghostscript #10

Closed
jimhall opened this issue Sep 9, 2020 · 2 comments · Fixed by #15
Closed

Comments

@jimhall
Copy link

jimhall commented Sep 9, 2020

Issue: Request that libgs.so or libgs.dylib (MacOS) be delivered in conda-forge Ghostscript

Details:

This is a request that conda-forge include a full distribution of Ghostscript rather than the truncated list of user land binaries for it. conda-forge does not include things like libraries and fonts with its distribution.

Reason for request / specific use case breaking:

Was trying to install and use the Camelot python package that can parse PDF tables. It declares a dependency on Ghostscript here. Executed the following steps in my conda env:

  • Installed the Camelot python package with no issues
  • Installed the conda-forge Ghostscript package with no issues
  • Ran the conda-forge gs per the Camelot docs with no issues

Then tried to run a simple confirmation script:

>>> import camelot
>>> tables = camelot.read_pdf('foo.pdf')
Traceback (most recent call last):
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py", line 260, in <module>
    libgs = cdll.LoadLibrary("libgs.so")
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/ctypes/__init__.py", line 442, in LoadLibrary
    return self._dlltype(name)
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/ctypes/__init__.py", line 364, 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 "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/io.py", line 117, in read_pdf
    **kwargs
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/handlers.py", line 172, in parse
    p, suppress_stdout=suppress_stdout, layout_kwargs=layout_kwargs
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/parsers/lattice.py", line 402, in extract_tables
    self._generate_image()
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/parsers/lattice.py", line 211, in _generate_image
    from ..ext.ghostscript import Ghostscript
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/ext/ghostscript/__init__.py", line 24, in <module>
    from . import _gsprint as gs
  File "/Users/jameshall/opt/anaconda3/envs/camelot/lib/python3.7/site-packages/camelot/ext/ghostscript/_gsprint.py", line 267, in <module>
    raise RuntimeError("Please make sure that Ghostscript is installed")
RuntimeError: Please make sure that Ghostscript is installed

Determined that libgs was not a part of the conda-forge package and could not find another Ghostscript related package for the libs and fonts.

I would think that other key python packages like PDFMiner would need the libs and fonts also.

Workaround: create conda environment without installing the conda-forge Ghostscript and install Ghostscript from Homebrew

Thanks for your consideration and let me know if I missed a step somewhere to get a full install of Ghostscript!


Environment (conda list):
# Name                    Version                   Build  Channel
bzip2                     1.0.8                haf1e3a3_3    conda-forge
ca-certificates           2020.7.22                     0  
cairo                     1.16.0            ha8983da_1005    conda-forge
camelot-py                0.8.2                      py_0    conda-forge
certifi                   2020.6.20                py37_0  
cffi                      1.14.2           py37hed5b41f_0  
chardet                   3.0.4           py37hc8dfbb8_1006    conda-forge
click                     7.1.2              pyh9f0ad1d_0    conda-forge
cryptography              3.1              py37h94e4008_0    conda-forge
cycler                    0.10.0                     py_2    conda-forge
et_xmlfile                1.0.1                   py_1001    conda-forge
ffmpeg                    4.3.1                h9903f1f_0    conda-forge
fontconfig                2.13.1            h79c0d67_1002    conda-forge
freetype                  2.10.2               h8da9a1a_0    conda-forge
gettext                   0.19.8.1             h1f1d5ed_1    conda-forge
ghostscript               9.22              h0a44026_1001    conda-forge
glib                      2.65.0               hc5f4afa_0  
gmp                       6.2.0                hb1e8313_2    conda-forge
gnutls                    3.6.13               hc269f14_0    conda-forge
graphite2                 1.3.13            h12caacf_1001    conda-forge
harfbuzz                  2.7.2                h8810732_0    conda-forge
hdf5                      1.10.6          nompi_haae91d6_101    conda-forge
icu                       67.1                 hb1e8313_0    conda-forge
idna                      2.10               pyh9f0ad1d_0    conda-forge
jasper                    1.900.1           h636a363_1006    conda-forge
jdcal                     1.4.1                      py_0    conda-forge
jpeg                      9d                   h0b31af3_0    conda-forge
kiwisolver                1.2.0            py37ha1cc60f_0    conda-forge
lame                      3.100             h1de35cc_1001    conda-forge
lcms2                     2.11                 h174193d_0    conda-forge
libblas                   3.8.0               17_openblas    conda-forge
libcblas                  3.8.0               17_openblas    conda-forge
libcxx                    10.0.1               h5f48129_0    conda-forge
libffi                    3.3                  hb1e8313_2  
libgfortran               4.0.0                         3    conda-forge
libgfortran4              7.5.0                h1565451_3    conda-forge
libiconv                  1.16                 haf1e3a3_0    conda-forge
liblapack                 3.8.0               17_openblas    conda-forge
liblapacke                3.8.0               17_openblas    conda-forge
libopenblas               0.3.10          openmp_h63d9170_4    conda-forge
libopencv                 4.4.0                    py37_2    conda-forge
libpng                    1.6.37               hb0a8c7a_2    conda-forge
libtiff                   4.1.0                h2ae36a8_6    conda-forge
libwebp-base              1.1.0                h0b31af3_3    conda-forge
libxml2                   2.9.10               h2c6e4a5_2    conda-forge
llvm-openmp               10.0.1               h28b9765_0    conda-forge
lz4-c                     1.9.2                hb1e8313_3    conda-forge
matplotlib-base           3.3.1            py37h886f89f_1    conda-forge
ncurses                   6.2                  hb1e8313_1    conda-forge
nettle                    3.4.1             h3efe00b_1002    conda-forge
numpy                     1.19.1           py37h1efc2f6_2    conda-forge
olefile                   0.46                       py_0    conda-forge
opencv                    4.4.0                    py37_2    conda-forge
openh264                  2.1.1                hd174df1_0    conda-forge
openpyxl                  3.0.5                      py_0    conda-forge
openssl                   1.1.1g               h1de35cc_0  
pandas                    1.1.1            py37hdadc0f0_0    conda-forge
pcre                      8.44                 h4a8c4bd_0    conda-forge
pdfminer.six              20200726                   py_1    conda-forge
pillow                    7.2.0            py37hfd78ece_1    conda-forge
pip                       20.2.2                     py_0    conda-forge
pixman                    0.38.0            h01d97ff_1003    conda-forge
py-opencv                 4.4.0            py37h43977f1_2    conda-forge
pycparser                 2.20               pyh9f0ad1d_2    conda-forge
pycryptodome              3.9.7            py37h22c4c0b_1    conda-forge
pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
pypdf2                    1.26.0                     py_2    conda-forge
python                    3.7.9                h26836e1_0  
python-dateutil           2.8.1                      py_0    conda-forge
python_abi                3.7                     1_cp37m    conda-forge
pytz                      2020.1             pyh9f0ad1d_0    conda-forge
readline                  8.0                  h0678c8f_2    conda-forge
setuptools                49.6.0           py37hc8dfbb8_0    conda-forge
six                       1.15.0             pyh9f0ad1d_0    conda-forge
sortedcontainers          2.2.2              pyh9f0ad1d_0    conda-forge
sqlite                    3.33.0               h960bd1c_0    conda-forge
tk                        8.6.10               hb0a8c7a_0    conda-forge
tornado                   6.0.4            py37h9bfed18_1    conda-forge
wheel                     0.35.1             pyh9f0ad1d_0    conda-forge
x264                      1!152.20180806       h1de35cc_0    conda-forge
xlwt                      1.3.0                    py37_0  
xz                        5.2.5                haf1e3a3_1    conda-forge
zlib                      1.2.11            h7795811_1009    conda-forge
zstd                      1.4.5                h289c70a_2    conda-forge
(camelot) jameshall@Jamess-MacBook-Pro initial-proposal % 



Details about conda and system ( conda info ):
% conda info

     active environment : camelot
    active env location : /Users/user/opt/anaconda3/envs/camelot
            shell level : 2 
       user config file : /Users/user/.condarc
 populated config files : /Users/user/.condarc
          conda version : 4.8.4
    conda-build version : 3.18.11
         python version : 3.8.3.final.0
       virtual packages : __osx=10.15.6
       base environment : /Users/user/opt/anaconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/user/opt/anaconda3/pkgs
                          /Users/user/.conda/pkgs
       envs directories : /Users/user/opt/anaconda3/envs
                          /Users/user/.conda/envs
               platform : osx-64
             user-agent : conda/4.8.4 requests/2.24.0 CPython/3.8.3 Darwin/19.6.0 OSX/10.15.6
                UID:GID : 501:20
             netrc file : None
           offline mode : False

@tdegeus
Copy link
Member

tdegeus commented Nov 5, 2020

Do you know how to implement this ? If I look at the build script all looks default : https://github.com/conda-forge/ghostscript-feedstock/blob/master/recipe/build.sh . So what options should be added ?

@jimhall
Copy link
Author

jimhall commented Nov 5, 2020

Not a ghostscript expert, but it looks like you need to add "make so":

From the owner of the code MacOS and UNIX mention the same step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants