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

Installation of Ghostscript - failed to load binary #313

Open
campmans opened this issue Apr 25, 2022 · 2 comments
Open

Installation of Ghostscript - failed to load binary #313

campmans opened this issue Apr 25, 2022 · 2 comments

Comments

@campmans
Copy link

@jravenel How are you doing? I tried installing Ghostscript. I tried to use pip for it. I tried to install ps2pdf binary, but I think it is only possible inside a container or maybe inside a sandbox. How about adding the feature that, if this OSError occurs, the user gets a prompt where it could click to put the binary inside a sandbox?

I would love to provide this functionality as a service to NAAS.ai. Running inside my CONTABO server in Germany, it would be faster (for the users in Europe) than running it in the Amazon cloud. Furthermore, it would be an enhancement for all users. Maybe it is a good idea to provide this functionality as an open source template?

Together with your collegue @Dr0p42 I will have a session tomorrow. This use case I would love to bring into the programming session. Any Ideas' awesomeness is required and useful!

Thanks in advance,
YOURS,

Tony Campmans
Eureka Connections

www.eurekaconnections.com
[email protected]
https://linkedin.com/eurekaconnections

Requirement already satisfied: ghostscript in /opt/conda/lib/python3.9/site-packages (0.7)
Requirement already satisfied: setuptools>=38.6.0 in /opt/conda/lib/python3.9/site-packages (from ghostscript) (62.1.0)

OSError                                   Traceback (most recent call last)
/opt/conda/lib/python3.9/site-packages/ghostscript/_gsprint.py in <module>
    523     try:
--> 524         libgs = cdll.LoadLibrary("libgs.so")
    525     except OSError:

/opt/conda/lib/python3.9/ctypes/__init__.py in LoadLibrary(self, name)
    459     def LoadLibrary(self, name):
--> 460         return self._dlltype(name)
    461 

/opt/conda/lib/python3.9/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    381         if handle is None:
--> 382             self._handle = _dlopen(self._name, mode)
    383         else:

OSError: libgs.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
<ipython-input-2-e750a341fdb0> in <module>
      1 get_ipython().system('pip install ghostscript')
      2 
----> 3 import ghostscript as gs

/opt/conda/lib/python3.9/site-packages/ghostscript/__init__.py in <module>
     30 
     31 import sys # :todo: remove, debugging only
---> 32 from . import _gsprint as gs
     33 __version__ = gs.__version__
     34 

/opt/conda/lib/python3.9/site-packages/ghostscript/_gsprint.py in <module>
    528         libgs = ctypes.util.find_library('gs')
    529         if not libgs:
--> 530             raise RuntimeError('Can not find Ghostscript library (libgs)')
    531         libgs = cdll.LoadLibrary(libgs)
    532 

RuntimeError: Can not find Ghostscript library (libgs)
@campmans
Copy link
Author

Assingee @Dr0p42 @jravenel
Comments @everyone!
Idea's @jravenel and Community

Thanks in advance!

Direct messages: and the caller is faster:
+31 30 205 9999
+31 6 49336954
[email protected]
https://www.eurekaconnections.com/contact

@jravenel
Copy link

Hey @campmans thanks for your message. What's the use case behind Ghostscript and ps2pdf ?

I think the prompt for install is a good idea.

Regarding local deployment, we will see with @Dr0p42 what can be done but at this stage of dev of the product we have to focus on AWS and the cloud microservices provided by Naas.

Still, open to discuss 😉.

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

No branches or pull requests

2 participants