java - Python tabula.io 错误:来自 tabula-java 的错误:未指定协议 线程“main”java.awt.AWTError 中的异常
问题描述
我正在解决我在使用基于 python 的 tabula-io 库时遇到的 pdf 解析问题。
tabula-py 版本:2.2.0 包 default-jre-headless 已安装
请帮我确定我在这里做错了什么,并提出可能的解决方案来解决这个问题?
任何帮助将一如既往地受到赞赏,始终感谢开发社区......
[tabula.io] ERROR: Error from tabula-java:
No protocol specified
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
at java.desktop/sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:102)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:61)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:315)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.createGE(GraphicsEnvironment.java:101)
at java.desktop/java.awt.GraphicsEnvironment$LocalGE.<clinit>(GraphicsEnvironment.java:83)
at java.desktop/java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:129)
at java.desktop/java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1181)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:327)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:268)
at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:254)
at technology.tabula.Utils.pageConvertToImage(Utils.java:285)
at technology.tabula.detectors.NurminenDetectionAlgorithm.detect(NurminenDetectionAlgorithm.java:101)
at technology.tabula.CommandLineApp$TableExtractor.extractTablesBasic(CommandLineApp.java:421)
at technology.tabula.CommandLineApp$TableExtractor.extractTables(CommandLineApp.java:408)
at technology.tabula.CommandLineApp.extractFile(CommandLineApp.java:180)
at technology.tabula.CommandLineApp.extractFileTables(CommandLineApp.java:124)
at technology.tabula.CommandLineApp.extractTables(CommandLineApp.java:106)
at technology.tabula.CommandLineApp.main(CommandLineApp.java:76)
exception is Command '['java', '-Dfile.encoding=UTF8', '-jar', '/usr/local/lib/python3.6/site-packages/tabula/tabula-1.0.5-jar-with-dependencies.jar', '--pages', 'all', '--guess', '--format', 'JSON', '/tmp/1539334171190.pdf']' returned non-zero exit status 1.
解决方案
推荐阅读
- angular - 执行命令 ng build --prod (Angular) 时出错
- javascript - 访问 reducer 中的嵌套键
- java - 无法运行standalone.bat 文件
- angularjs - Angular js es6按复选框过滤列表
- python - 在 python 2.7 上使用 pandas
- function - 如何填充 vuejs 2 隐藏的输入?
- python - nginx 主管 django gunicorn 404
- php - Laravel如何在控制器中获取Helper函数返回值作为url路径
- android - 如何在 Kotlin 中将数组转换为集合(HashSet)?
- sql - 多个插入与一个具有多个值的插入