Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Having trouble installing expat and XML::Parser on Mac OS X. Please help!

by MrSnrub (Sexton)
on Nov 13, 2011 at 01:02 UTC ( #937786=perlquestion: print w/ replies, xml ) Need Help??
MrSnrub has asked for the wisdom of the Perl Monks concerning the following question:

Hello! I am trying to install XML::Parser, and I understand that before I do that I have to install expat. I launch a Terminal window and type "sudo port install expat" and that gives the following output:

---> Fetching archive for expat ---> Attempting to fetch expat-2.0.1_1.darwin_10.x86_64.tbz2 from http://packages.macports.org/expat ---> Fetching expat ---> Attempting to fetch expat-2.0.1.tar.gz from http://ykf.ca.distfiles.macports.org...istfiles/expat ---> Verifying checksum(s) for expat ---> Extracting expat ---> Configuring expat ---> Building expat ---> Staging expat into destroot ---> Installing expat @2.0.1_1 ---> Activating expat @2.0.1_1 ---> Cleaning expat

I then type "port installed" and "expat @2.0.1_1 (active)" appears. So far so good. I then try to install XML::Parser. I downloaded XML- Parser-2.41.tar.gz. I cd to my Downloads folder and type in "gzip -d XML-Parser-2.41.tar.gz" and "tar xvf XML-Parser-2.41.tar.gz" and that creates a directory called XML-Parser-2.41. I cd to that directory and type "perl Makefile.pl" and I receive the following error message:

Expat must be installed prior to building XML::Parser and I can't find it in the standard library directories. Install 'expat-devel' package with your OS package manager. See 'README'.

I try to install expat-devel by typing in "sudo port install expat- devel" but that gives an error message "Error: Port expat-devel not found." I am completely at a loss here. Where am I going wrong? Is expat still not completely installed? Is there some additional configuring I need to do before moving on to the XML::Parser step?

Comment on Having trouble installing expat and XML::Parser on Mac OS X. Please help!
Download Code
Replies are listed 'Best First'.
Re: Having trouble installing expat and XML::Parser on Mac OS X. Please help!
by MVS (Monk) on Nov 13, 2011 at 03:08 UTC

    The file expat-2.0.1_1.darwin_10.x86_64.tbz2 does seem to include the libraries that XML::Parser is looking for, so it's most likely that Makefile.PL is just looking in the wrong place. Note that it should have also displayed this message:

    If expat is installed, but in a non-standard directory, then use the following options to Makefile.PL: EXPATLIBPATH=... To set the directory in which to find libexpat EXPATINCPATH=... To set the directory in which to find expat.h For example: perl Makefile.PL EXPATLIBPATH=/home/me/lib EXPATINCPATH=/home/me/i +nclude

    So, based on the structure in the tarball, you could try:

    perl Makefile.PL EXPATLIBPATH=/opt/local/lib EXPATINCPATH=/opt/local/include
Re: Having trouble installing expat and XML::Parser on Mac OS X. Please help!
by Anonymous Monk on Nov 13, 2011 at 01:09 UTC

    I am completely at a loss here. Where am I going wrong? Is expat still not completely installed? Is there some additional configuring I need to do before moving on to the XML::Parser step?

    You're getting spooked by a warning

    If you had used cpan XML::Parser or cpanp i XML::Parser, they would have ignored the warning, and went on to call

    make make test make install
    and most likely, it would have just worked

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2015-07-28 16:24 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 (258 votes), past polls