Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Can't locate XML/LibXML.pm in @INC

by kingsaint (Novice)
on Sep 23, 2013 at 04:35 UTC ( #1055228=perlquestion: print w/ replies, xml ) Need Help??
kingsaint has asked for the wisdom of the Perl Monks concerning the following question:

I need to use XML::LibXML in my project to handle a complex xml structure. I installed the corresponding perl module "perl-XML-LibXML-1.70-5.el6.src.rpm " as I'm using a system with CentOS 6(Kernel version-2.6.32-358.11.1.el6.centos.plus.x86_64). The above module installed with the following warnings:

1:perl-XML-LibXML warning: user mockbuild does not exist - usin +g root warning: group mockbuild does not exist - using root warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root ########################################### [100%]

Then I tried to write a simple perl script to test whether it's working or not. Following is my test code:

test_2.pl -----------
#!/usr/bin/perl use XML::LibXML; $parser = XML::LibXML->new(); $doc = $parser->parse_file('TreeList_dup.xml'); print $doc->toString;

But here is the error message I got:

Can't locate XML/LibXML.pm in @INC (@INC contains: /usr/local/lib64/p +erl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/p +erl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at test_2.pl li +ne 3. BEGIN failed--compilation aborted at test_2.pl line 3.

Can anyone help me to understand the error message and tell me how to recover from it?

Comment on Can't locate XML/LibXML.pm in @INC
Select or Download Code
Replies are listed 'Best First'.
Re: Can't locate XML/LibXML.pm in @INC
by tobyink (Abbot) on Sep 23, 2013 at 06:06 UTC

    You installed a .src.rpm file. This is the source code for the package; it is not what you want. The compiled module will be in an i586.rpm or x86_64.rpm or similar.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

      Thanks for the reply.Well, I tried to install

      perl-XML-LibXML-1.70-5.el6.x86_64.rpm. It threw the following error message:
      error: Failed dependencies: perl(XML::SAX::DocumentLocator) is needed by perl-XML-LibXML-1:1.7 +0-5.el6.x86_64

      To resolve the dependency, I tried to install

      perl-XML-SAX-0.96-7.el6.noarch.rpm.

      It threw the following error message:

      error: Failed dependencies: perl(XML::LibXML) is needed by perl-XML-SAX-0.96-7.el6.noarch

      Why there exists a cross dependency between XML::LibXML and XML::SAX::DocumentLocator? How to resolve it?

        Why there exists a cross dependency between XML::LibXML and XML::SAX::DocumentLocator?

        Because whomever created the RPMs you're using made it that way

        there is no such cross dependency on CPAN. XML::SAX doesn't require XML::LibXML, but XML::LibXML requires

        How to resolve it?

        Force installation (every package manager has the option), or use cpan or cpanm to install XML::LibXML

        How to resolve it?

        Install both at the same time.

        Take the time to learn the tools you are working with!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1055228]
Approved by hdb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2015-07-31 01:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls