gpt4 book ai didi

python - 将 tika 与 python 一起使用,runtimeerror : unable to start tika server

转载 作者:太空狗 更新时间:2023-10-29 21:00:08 31 4
gpt4 key购买 nike

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

我在 Jupyter 中的代码是:

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

但是,我收到以下错误:

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.

RuntimeError: Unable to start Tika Server.

最佳答案

根据 Apache Tika's site ,所有新版本的 tika-server.jar 都需要 Java 8。

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,则会在运行时自动下载。

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

关于python - 将 tika 与 python 一起使用,runtimeerror : unable to start tika server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51514246/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com