perl – 安装XML :: Parser需要expat.h

perl – 安装XML :: Parser需要expat.h,第1张

概述我正在开发一个项目,需要将所有第三方(读取:CPAN)perl模块安装在perforce存储库中,这样任何依赖于它们的代码都可以成功运行,而无需其他人手动安装它们.我在尝试安装 XML :: Parser时遇到了一个问题.我使用cpanminus来安装我的CPAN模块,所以我运行了cpanm -L. XML :: Parser在所需的目录中(这在以前与其他模块一起工作)并得到错误: Expat.x 我正在开发一个项目,需要将所有第三方(读取:CPAN)perl模块安装在perforce存储库中,这样任何依赖于它们的代码都可以成功运行,而无需其他人手动安装它们.我在尝试安装 XML :: Parser时遇到了一个问题.我使用cpanminus来安装我的CPAN模块,所以我运行了cpanm -L. XML :: Parser在所需的目录中(这在以前与其他模块一起工作)并得到错误:

Expat.xs:12:19: error: expat.h: No such file or directory

我习惯使用Ubuntu和apt-get,但在工作中我必须使用RedHat,我不知道如何将expat安装到本地目录.我跑了yum搜索expat并得到了

expat.i386 : A library for parsing XML.expat.x86_64 : A library for parsing XML.

所以我尝试了yum install –installroot =. expat.i386并出现以下错误:

Loaded plugins: rhnplugin,securityerror: cannot open Packages index using db3 - No such file or directory (2)error: cannot open Packages database in ./var/lib/rpmTraceback (most recent call last):  file "/usr/bin/yum",line 29,in ?    yummain.user_main(sys.argv[1:],exit_code=True)  file "/usr/share/yum-cli/yummain.py",line 309,in user_main    errcode = main(args)  file "/usr/share/yum-cli/yummain.py",line 157,in main    base.getoptionsConfig(args)  file "/usr/share/yum-cli/cli.py",line 187,in getoptionsConfig    self.conf  file "/usr/lib/python2.4/site-packages/yum/__init__.py",line 665,in <lambda>    conf = property(fget=lambda self: self._getConfig(),file "/usr/lib/python2.4/site-packages/yum/__init__.py",line 240,in _getConfig    self._conf = config.readMainConfig(startupconf)  file "/usr/lib/python2.4/site-packages/yum/config.py",line 804,in readMainConfig    yumvars['releasever'] = _getsysver(startupconf.installroot,startupconf.distroverpkg)  file "/usr/lib/python2.4/site-packages/yum/config.py",line 877,in _getsysver    IDx = ts.dbMatch('provIDes',distroverpkg)TypeError: rpmdb open Failed

我究竟做错了什么?此外,一旦我安装了expat,我不知道如何告诉cpanm在哪里找到它.

解决方法 我看到了一些可以帮助你走上正确道路的事情.首先,您想要的包称为expat-devel.此外,我认为您需要提供–installroot选项的绝对路径,并且您可能不需要向yum​​提供包扩展,除非这与您构建这些模块的方式相关(即,您通常可以只做yum install expat-devel).

看起来你的rpmdb可能有问题,因为你得到了“rpmdb open Failed”消息.你可以运行yum check来查找rpmdb中的问题,但除此之外我不能说具体的包管理器.也许其他人可以在这方面提供更多帮助.

总结

以上是内存溢出为你收集整理的perl – 安装XML :: Parser需要expat.h全部内容,希望文章能够帮你解决perl – 安装XML :: Parser需要expat.h所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1260577.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-08
下一篇2022-06-08

发表评论

登录后才能评论

评论列表(0条)

    保存