Does anyone know how to get GhostScript working in Iron.io workers?
I am using the ffmpeg stack with node.js and need to convert a pdf to a series of jpegs using imagemagic and GhostScript is required for this.
You could add almost any .deb file to a worker package via keyword deb
(working) example:
runtime "node"
exec "run.js"
stack 'node-0.10'
deb 'http://archive.ubuntu.com/ubuntu/pool/main/g/ghostscript/ghostscript_9.10~dfsg-0ubuntu10.2_amd64.deb'
remote # important, turn remote building on
Also, you could find some other helpful examples there: https://github.com/iron-io/iron_worker_examples/tree/master/deb-packages
Related
Error Message: Please make sure that Ghostscript is installed", "errorType": "RuntimeError"
import camelot
def pdfToJson(event=None, context=None):
tables = camelot.read_pdf("./week-1-2019-20.pdf")
tables[0].df.to_json("./sample.json")
Installed the dependencies with pip install -t .
But still getting the error.
How can I install the "ghostscript" dependency in my python code?
I haven't tried this myself, but you should be able to do this with a Lambda Layer. You can see an example of how this is done via https://github.com/BearTail/ghostscript-aws-lambda-layer.
Some magic may also be needed to tell camelot that the Ghostscript binary can be found at /opt/bin/gs, as that isn't a normal location for it.
In camelot library communication with Ghostscript done via a low-level C-API interface with ctypes usage. Ghostscript is used to generate images from pdf being processed by the library.
You do not need to install any python binding by yourself, the only requirement is Ghostscript itself. The easiest way to install is to use repositories/CD, on Ubuntu simple as that:
sudo apt-get install -y ghostscript
gs --version
I want to build a Markdown to PDF converter running on Heroku using Pandoc and LaTeX that I can send markdown to and it will return a PDF. On my local machine this worked fine without any problem. I am using Pandoc 2.7.3 and pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019).
Now I wanted to host this on heroku, but I just get errors for missing files when I run the pandoc command because the versions are old or don't match.
What is the easiest way to get this to run?
Heroku obviously has some limitations on the slug size (500mb), so a full tex install is not possible. It would need to be a smaller subset.
There are Buildpacks for pandoc and TeX Live, but espacially the TeX Live buildpacks seem to be outdated and is not compatible with the pandoc one if you try to run the latest version. The Apt package seems also to maintain only an older version. Is a docker image maybe the answer? https://devcenter.heroku.com/articles/container-registry-and-runtime
I am not necessarily searching for installation instructions, but rather in which way you would handle that. I am a web developer, not a dev ops, so i am really lost in this LaTeX install mess.
I am new to docker but managed to build myself some dev-environment images ( which is awesome! ). But i wasn't quite satisfied with the filesize of the resulting image, so i tried to migrate the image from node-argon image ( based on debian-wheezy ) to alpine image. Problem is that the installation of vagrant.deb package isn't working correctly. I installed the alpine dpkg package, but get these errors:
dpkg: error: failed to open package info file '/var/lib/dpkg/status' for reading: No such file or directory
I found some threats about this topic, but were not related to alpine installation and wouldn't fix my issues. Relevant docker lines are:
FROM gliderlabs/alpine:3.3
RUN apk add --update dpkg
ENV VAGRANT_VERSION 1.8.1
ADD https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb .
RUN dpkg -i vagrant_${VAGRANT_VERSION}_x86_64.deb
RUN rm vagrant_*.deb
Someone else got this working - my guess was that there maybe some build/install dependencies missing, but couldn't get it any further. Any advice would be much appriciated.
All the best, florian
In comments below the question we found out, that it is indeed possible to install the vagrant.deb using dpkg on Alpine Linux. However, it was really hackish(!) and at the end the advantage in size of the Alpine Linux didn't matter since the resulting image had a size of 2.5G =).
That's why my answer is (I said that before): Make your life easy and use a Debian or Ubuntu image if you want to install deb packages :)
For all potential Alpine-container users, please think twice if you really need a base image that is a couple of MB smaller than common GNU/Linux base images. You'll pay the price for that few MBs with having a poor shell environment (Welcome to the 80s!) and a significantly smaller amount of available packages.
If you want a minimal container then don't put a distribution into a container, put a process into a container!
Ultimate Goal:
I'm trying to convert a binary plist file to an xml format so that I can put it in an array and grab values from it. What I'm finding via web search on this is that the command for Linux comes from libplist.
Problem: I ran "yum install libplist" and it told me libplist is already installed and latest version. I've read that if I enter the following command:
plutil -i /mypath/file.plist > /mypath/file.xml.plist
That this will help accomplish my ultimate goal. However, when I do this only a blank file called file.xml.plist is created. Further, with this command and any other command involving plutil, I get a "bash: plutil: command not found. . ." error. Is libplist seemingly not installed (even though it says it is) or why would I repeatedly get this error? Thanks for your help.
You can use yum to look for a package knowing the binary you want. For instance, if I want to install the package that provides plutil, I simply run this command:
$> yum provides plutil
Unfortunately, the result is No matches found... But you say you read that the libplist package provides this tool. Maybe it was renamed ? Let's use repoquery for this (if you don't have it, yum provides repoquery tells you that you need to install yum-utils).
$> repoquery --list libplist
/usr/bin/plistutil
/usr/lib/libplist++.so.3
/usr/lib/libplist++.so.3.0.0
/usr/lib/libplist.so.3
/usr/lib/libplist.so.3.0.0
/usr/share/doc/libplist
/usr/share/doc/libplist/AUTHORS
/usr/share/doc/libplist/COPYING.LESSER
/usr/share/doc/libplist/README
And what I see is that a program called plistutil was installed with this package !
I've never used plutil, so I can't tell you for sure plistutil is the program you want (but it probably is). What I wanted to do instead with this post is to show how you can use yum to install the packages you need !
I ran across this thread while Googling for the same thing myself. After looking at a few solutions for my own company (Screenplay) I decided to fork and iterate on a open-source, cross-platform, drop-in replacement for plutil:
https://github.com/screenplaydev/plutil
It's forked from Facebook's xcbuild (a tool developed by them to build xcode projects on Linux), but stripped down to just provide plist-editting functionality. That way you won't need to maintain separate code-paths for Mac and Linux environments.
Hope that's helpful!
I have just downloaded the youtube-dl-2014.07.15.tar_2.gz in my windows. At first I want to tell I don't know anything about python. And I already have installed python 2.7. Can anyone give me instruction to execute these scripts?
I have already tried to run...but there is some error like these. "No mudule named youtube-dl"
I want a fresh start. Now I am using windows 8.1 and I have also tried youtube-dl.exe. And there is also problem like screenshot
If I want to get worked both script and program what will I do?Any helps will be appreciated. If you give me instruction from scratch that will be better.
To install youtube_dl in Python on Windows (command from their github):
Tested with Python 3.9 on Windows 10
pip install --upgrade youtube-dl
Now when using it, notice that the name of the Python module is with an underscore.
Because it is a Python module, use it like so:
py -m youtube_dl <video url>
Of course video url is the video you want to download
This seems to be caused by a limitation of py2exe. You may want to file a youtube-dl bug report for moving to a cxfreeze, which should not have that problem. In any case, simply moving the youtube-dl.exe file into another directory such as C:\Users\Shamim should fix the problem.
you need just to put the youtube-dl.exe file in in your home directory or any other location on your PATH.
You can see your PATH in your "Envirenment Variables"