在@INC 中找不到 Algorithm/Diff.pm(您可能需要安装 Algorithm::Diff 模块)

在@INC 中找不到 Algorithm/Diff.pm(您可能需要安装 Algorithm::Diff 模块)

我遇到了与封闭问题“https://tex.stackexchange.com/questions/104350/problem-regarding-latexdiff-perl-and-miktex-2-9-on-win7”中描述的相同的问题。

在我的情况下,以下解决方案不起作用。但是,错误消息现在包含我添加的路径(见下文)。

我已经在 Win10 上通过 MikTeX 2.9 控制台安装了 latexdiff。最初尝试使用 ActivePerl,然后卸载并安装 Strawberry Perl。问题仍然存在。

$ latexdiff
Can't locate Algorithm/Diff.pm in @INC (you may need to install the Algorithm::Diff module) (@INC contains: C \Strawberry\perl\site\lib /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at C:\Users\pea77\AppData\Local\Programs\MiKTeX 2.9\scripts/latexdiff\latexdiff line 193.
BEGIN failed--compilation aborted at C:\Users\pea77\AppData\Local\Programs\MiKTeX 2.9\scripts/latexdiff\latexdiff line 193.

答案1

从 Perl 的 CPAN 软件包存储库安装Algorithm::Diff软件包。您可以通过运行以下命令来执行此操作。

perl -MCPAN -e "install Algorithm::Diff"

答案2

从 CPAN 安装是正确的解决方案,但如果您在 Windows 下使用 MSYS2 中的 Perl,则安装会失败并出现神秘错误。在这种情况下,使用以下命令安装它pacman

pacman -S perl-Algorithm-Diff

相关内容