将 tika 与 python 一起使用,runtimeerror: 无法启动 tika 服务器 [英] Use tika with python, runtimeerror: unable to start tika server

查看:63
本文介绍了将 tika 与 python 一起使用,runtimeerror: 无法启动 tika 服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 tika 包来解析文件.Tika 安装成功,tika-server-1.18.jar 在 cmd 中运行 Code Java -jar tika-server-1.18.jar

I am trying to use the tika package to Parse files. Tika is successfully installed, tika-server-1.18.jar runned with Code in cmd Java -jar tika-server-1.18.jar

我在 Jupyter 中的代码是:

My code in the Jupyter is:

Import tika 
from tika Import parser
parsed = parser.from_file('')

但是,我收到以下错误:

However, I receive below error:

2018-07-25 10:20:13,325 [MainThread] [WARNI] 看不到启动日志消息;重试... 2018-07-25 10:20:18,329 [主线程][WARNI] 无法查看启动日志消息;重试... 2018-07-2510:20:23,332 [MainThread] [WARNI] 无法查看启动日志信息;重试... 2018-07-25 10:20:28,340 [MainThread] [错误]3 次尝试后未收到 Tika 启动日志消息.2018-07-2510:20:28,340 [MainThread] [ERROR] 接收启动失败来自 startServer 的确认.

2018-07-25 10:20:13,325 [MainThread ] [WARNI] Failed to see startup log message; retrying... 2018-07-25 10:20:18,329 [MainThread ] [WARNI] Failed to see startup log message; retrying... 2018-07-25 10:20:23,332 [MainThread ] [WARNI] Failed to see startup log message; retrying... 2018-07-25 10:20:28,340 [MainThread ] [ERROR] Tika startup log message not received after 3 tries. 2018-07-25 10:20:28,340 [MainThread ] [ERROR] Failed to receive startup confirmation from startServer.

运行时错误:无法启动 Tika 服务器.

RuntimeError: Unable to start Tika Server.

推荐答案

根据 Apache Tika 的网站,所有tika-server.jar 的新版本将需要 Java 8.

According to Apache Tika's site, all new versions of the tika-server.jar will require Java 8.

2018 年 4 月 24 日:Apache Tika 发布Apache Tika 1.18 已经发布!此版本包括错误修复(例如从 PPT 中的分组形状中提取)、安全修复和依赖项升级.请注意:下一个版本将需要 Java 8.请参阅 CHANGES.txt 文件以获取发行版中的完整更改列表,并查看下载页面以获取有关如何获取 Apache Tika 1.18 的更多信息.

24 April 2018: Apache Tika Release Apache Tika 1.18 has been released! This release includes bug fixes (e.g. extraction from grouped shapes in PPT), security fixes and upgrades to dependencies. PLEASE NOTE: The next versions will require Java 8. Please see the CHANGES.txt file for the full list of changes in the release and have a look at the download page for more information on how to obtain Apache Tika 1.18.

tika Python 库的当前过时文档声称需要 Java 7,但现在必须安装 Java 8.这是因为如果在您的临时文件中找不到当前版本的 tika-server.jar,则会在运行时自动下载.

Current outdated docs for tika Python library claim that Java 7 is needed, but now Java 8 must be installed. This is because the current version of tika-server.jar is automatically downloaded at runtime if not found in your temp file.

安装 Java 8 后,我的基本测试代码启动了服务器并正常运行.

After installing Java 8, my basic test code launched the server and worked without error.

这篇关于将 tika 与 python 一起使用,runtimeerror: 无法启动 tika 服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆