错误信息: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")
所以如何在我的python代码中安装“ ghostscript”依赖项。
在camelot
库中,与Ghostscript
的通信是通过使用ctypes
的低级C-API接口完成的。 Ghostscript用于从库处理的pdf生成图像。
您不需要自己安装任何python绑定,唯一的要求就是Ghostscript本身。最简单的安装方法是在Ubuntu上使用repositories/CD,就像这样:
sudo apt-get install -y ghostscript
gs --version