如何安装 ActivePerl 的 XML::LibXML?

发布于 2024-08-04 12:40:17 字数 806 浏览 4 评论 0原文

我是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

眼泪也成诗 2024-08-11 12:40:17

您应该能够使用 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

吹梦到西洲 2024-08-11 12:40:17

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.

泪之魂 2024-08-11 12:40:17

我最近经历了安装 XML::LibXML 的痛苦。这是我发现的:

  1. 我们正在使用 ActiveState ActivePerl 5.8.8
  2. 为了让 ActivePerl 的 PPM 通过我们的代理,必须创建一个环境变量“http_proxy”,其值为“http://proxy.ext.[example].com” ”,然后重新登录。
  3. 所需的包并不全部位于 ActiveState 的存储库中。添加了温尼伯大学的 Perl 存储库 http://theoryx5.uwinnipeg.ca/ppms/package.xml (请注意,使用的确切存储库取决于您的 ActivePerl 版本)
  4. 手动将以下 DLL 安装到 C:\perl\bin\ (无论出于何种原因,我在构建这些 DLL 时遇到了一些麻烦,所以我最终只是简单地获取它们来自 http://trouchelle.com/ppm/dll/ 的存储库)
    • iconv.dll
    • libxml2.dll
    • zlib1.dll
  5. 至少对于我们正在使用的 XML-LibXML 版本,软件包安装程序无法针对先决条件 XML-LibXML-Common 正常工作。您必须单独安装 XML-LibXML-Common 包,安装 XML-LibXML 的其余部分。

虽然它们可能不是最新版本,但我当前使用的软件包版本(包括先决条件)是:

  • XML-LibXML-Common (ver 0.13)
  • XML-LibXML (ver 1.64)
  • XML-NamespaceSupport (ver 1.10)
  • XML- SAX(0.96 版)

I have recently been through the pains of getting XML::LibXML installed. Here is what I found:

  1. We are using ActiveState ActivePerl 5.8.8
  2. In order for ActivePerl's PPM to get through our proxy, had to create an environment variable "http_proxy" with value "http://proxy.ext.[example].com", then re-login.
  3. The required packages weren't all located in ActiveState's repository. Added University of Winnipeg's Perl Repository http://theoryx5.uwinnipeg.ca/ppms/package.xml (note that the exact repository used depends on your version of ActivePerl)
  4. Manually install the following DLLs into C:\perl\bin\ (for whatever reason, I was having some trouble building these DLLs, so I ended up simply grabbing them from the repository at http://trouchelle.com/ppm/dll/ )
    • iconv.dll
    • libxml2.dll
    • zlib1.dll
  5. At least for the version of XML-LibXML we are using, the package installer doesn't work correctly for the prerequisite XML-LibXML-Common. You MUST install the package XML-LibXML-Common by itself, BEFORE installing the rest of XML-LibXML.

Although they may not be the latest versions, the versions of the packages (including prerequisites) which I am currently using are:

  • XML-LibXML-Common (ver 0.13)
  • XML-LibXML (ver 1.64)
  • XML-NamespaceSupport (ver 1.10)
  • XML-SAX (ver 0.96)
调妓 2024-08-11 12:40:17

接受的答案在 5.16 上对我不起作用。来自这个问题

XML::LibXML 尚未为 Perl 5.16 做好准备。安装5.14

下载:

Accepted answer didn't work for me on 5.16. From this question:

XML::LibXML was not ready for Perl 5.16. Install 5.14

Download:

匿名。 2024-08-11 12:40:17

最后,据我所知,我发现了唯一的替代 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文