如何安装 ActivePerl 的 XML::LibXML?
我是 Perl 新手,我正在使用 ActivePerl。 我收到以下错误:
在 @INC 中找不到 XML/LibXML.pm...
我已尝试了所有方法,但找不到为 XML::LibXML 安装“正确”模块的步骤。
这正是正在发生的事情。我正在从命令提示符运行脚本:
c:\temp>perl myscript.pl
myscript.pl 的前几行:
#!/usr/bin/perl
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use HTTP::Date;
use XML::Parser;
use LWP::UserAgent;
use XML::LibXML;
use Archive::Extract;
use Encode;
use LWP::Simple;
require HTTP::Request;
...
然后我收到此错误:
c:\temp>perl myscript.pl 找不到 @INC 中的 XML/LibXML.pm(@INC 包含: C:/Perl/site/lib C:/Perl/lib 。)位于 myscript.pl 第 7 行。开始 失败——编译中止于 myscript.pl 第 7 行
I am new to Perl and I am using ActivePerl.
I am getting the following error:
Can't locate XML/LibXML.pm in @INC...
I have tried everything but cannot find the steps to install the "correct" module for XML::LibXML.
Here is exactly what is going on. I am running a script from a command prompt:
c:\temp>perl myscript.pl
The first few lines of myscript.pl:
#!/usr/bin/perl
use Archive::Zip qw( :ERROR_CODES :CONSTANTS );
use HTTP::Date;
use XML::Parser;
use LWP::UserAgent;
use XML::LibXML;
use Archive::Extract;
use Encode;
use LWP::Simple;
require HTTP::Request;
...
Then I get this error:
c:\temp>perl myscript.pl Can't locate
XML/LibXML.pm in @INC (@INC contains:
C:/Perl/site/lib C:/Perl/lib .) at
myscript.pl line 7. BEGIN
failed--compilation aborted at
myscript.pl line 7
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您应该能够使用 ActivePerl Perl 包管理器 安装它。安装ActivePerl时应该已经创建了一个开始菜单快捷方式,启动 GUI 并搜索 xml-libxml 和 libxml-perl。
--edit
这是一篇关于向 PPM 添加替代存储库并安装 XML-LibXML 的文章
You should be able to install it with the ActivePerl Perl Package Manager. There should have been a start menu shortcut created when you installed ActivePerl, start the GUI and search for xml-libxml and libxml-perl.
--edit
Here's a post on adding an alternative repository to PPM and installing XML-LibXML
ActiveState 似乎没有提供带有 XML::LibXML 的 PPM。我查看了 CPAN 上模块的自述文件,显然可以在 此处 获取预构建 ppm 包。
It doesn't look like ActiveState provide a PPM with XML::LibXML. I looked in the README for the module on CPAN and apparently a prebuild ppm package is available here.
我最近经历了安装 XML::LibXML 的痛苦。这是我发现的:
虽然它们可能不是最新版本,但我当前使用的软件包版本(包括先决条件)是:
I have recently been through the pains of getting XML::LibXML installed. Here is what I found:
Although they may not be the latest versions, the versions of the packages (including prerequisites) which I am currently using are:
接受的答案在 5.16 上对我不起作用。来自这个问题:
下载:
Accepted answer didn't work for me on 5.16. From this question:
Download:
最后,据我所知,我发现了唯一的替代 ActivePerl 存储库,它有一个 XML::LibXML 2.0121 包,它将安装在最高 5.20.x 的 perl 版本上。
您可以从此处获取包含 5.20.2 的 ActivePerl 版本: downloads.activestate.com/ActivePerl/releases/
替代存储库称为 Bribes de Perl,位于 bribes.org/perl/
在选项中输入的存储库的 URL 为http://bribes.org/perl/ppm/
In the end I found the only alternative ActivePerl repository in existence, as far as I can tell, and it had a package for XML::LibXML 2.0121 which will install on perl versions up to 5.20.x.
You can obtain releases of ActivePerl from here that includes 5.20.2: downloads.activestate.com/ActivePerl/releases/
The alternative repository is called Bribes de Perl at bribes.org/perl/
The URL of the repository that is entered in options is http://bribes.org/perl/ppm/