无法在CMD中使用选项解析器来运行脚本

2024-09-28 03:24:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我最近想使用脚本Wikiextractor从Wikipedia的Cirrus dumps中执行提取。你知道吗

在“git克隆”了所有文件之后,当我直接调用脚本时,它工作得很好

C:\Users\User\Documents\GitHub\wikiextractor>python wikiextractor.py enwiki-pages-articles.xml.bz2

但是我也想安装它(通过运行设置.py提供)并在其他目录中使用。 成功安装wikiextractor后,我将cd放入具有相同文件(enwiki页面)的目录中-文章.xml.bz2)并尝试再次运行脚本。你知道吗

C:\Users\User\Desktop\Wikidump>wikiextractor.py enwiki-pages-articles.xml.bz2

出现以下错误消息。你知道吗

usage: WikiExtractor.py [-h] [-o OUTPUT] [-b n[KMG]] [-c] [--json] [--html]
                    [-l] [-s] [--lists] [-ns ns1,ns2]
                    [--templates TEMPLATES] [--no-templates] [-r]
                    [--min_text_length MIN_TEXT_LENGTH]
                    [--filter_disambig_pages] [-it abbr,b,big]
                    [-de gallery,timeline,noinclude] [--keep_tables]
                    [--processes PROCESSES] [-q] [--debug] [-a] [-v]
                    input
WikiExtractor.py: error: the following arguments are required: input

为什么会这样? 我希望我把一切都解释清楚。你知道吗


Tags: 文件py目录脚本inputxmlpagesusers

热门问题