mineru-kit CLI:当output.md已存在时,报错信息与实际错误不符
Author: Yan-XiangjunCreated Sep 21, 2026Updated Sep 22, 2026
Labelsbug
Search before asking | 提交之前请先搜索
- I have searched the MinerU Readme and found no similar bug report.
- I have searched the MinerU Issues and found no similar bug report.
- I have searched the MinerU Discussions and found no similar bug report.
Consult the online AI assistant for assistance | 在线 AI 助手咨询
- I have consulted the online AI assistant but was unable to obtain a solution to the issue.
Description of the bug | 错误描述
采用下列命令解析单个PDF:
mineru-kit parse "sample.pdf" -o document.md --tier standard如果document.md已存在,会报错: “Error: When input is multiple files or directories, --output must be a directory path.” 删掉document.md则可以正常运行。 但该报错信息并没有反映实际的错误原因,并非“input is multiple files or directories”。
该报错信息似乎源自mineru/kit/common.py的Line 77:
output_dir = output
if output.exists() and output.is_file():
raise ValueError(t("When input is multiple files or directories, --output must be a directory path."))output.exists() and output.is_file()与"When input is multiple files or directories, --output must be a directory path."是不对应的。
How to reproduce the bug | 如何复现
使用下列命令安装MinerU version: 4.0.5:
uv pip install -U "mineru[full]>=4.0,<5"执行两遍下列命令:
mineru-kit parse "sample.pdf" -o document.md --tier standard然后就会报错“Error: When input is multiple files or directories, --output must be a directory path.”。
Operating System Mode | 操作系统类型
Linux
Operating System Version| 操作系统版本
Ubuntu 22.04
Python version | Python 版本
3.12
Software version | 软件版本 (mineru --version)
4.0.0.dev20260626
Backend name | 解析后端
vlm
Device mode | 设备模式
cuda
Source: opendatalab/MinerU