XML Parser perl module is needed - perl

I'm trying to install intltool on Debian (Raspberry Pi). When running
./configure
The system always come back with the error:
checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
But I do have the latest version libxml and libxml-libxml-perl installed.
Can anyone help me interpret what is missing here?
Thank you!
Paul

You need to install XML::Parser::Style::Tree module. Try with cpanm
cpanm XML::Parser::Style::Tree
Or using CPAN Shell
perl -MCPAN -e shell
install XML::Parser::Style::Tree
After that, the module will be installed and XML::Parser will work well.

Related

Why doesn't perl find my installed SSH2 module?

So I am trying to run a perl script on my Centos machine. I have tried on Centos 5,6,7 with no success. Every time I run the script I get this:
Can't locate Net/SSH2.pm in #INC (#INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)
I have installed libssh2
Package libssh2-1.4.3-12.el7.x86_64 already installed and latest version
I have tried using cpan but no matter what I do it doesn't seem to work.
I just don't understand why perl isn't finding the module... Am I missing something?
If somebody could guide me to actually installing the SSH2 module because I have looked everywhere and nothing seems to work.
Thanks in advance.
UPDATE:
When I try to install via cpan:
cpan[1]> install Net::SSH2
Reading '/root/.cpan/Metadata'
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
........................................................................DONE
Reading '/root/.cpan/sources/modules/02packages.details.txt.gz'
Database was generated on Fri, 04 Jan 2019 22:17:03 GMT
HTTP::Date not available
.............
New CPAN.pm version (v2.22) available.
[Currently running version is v1.9800]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.
........................................Killed
Still getting the same error...
libssh is the C library for SSH. Net::SSH2 is a Perl module. They are different piece of software (although Net::SSH2 probably depends on libssh).
You need to install Net::SSH2.
See What's the easiest way to install a missing Perl module?
As Quentin mentioned in his answer, libssh2 is the C library for SSH, whereas Net::SSH2 is a Perl module. Since Net::SSH2 will be installed from source (which is what the cpan command does in the background), you will need to ensure that a few prerequisites are installed:
sudo yum install libssh2 libssh2-devel gcc
The libssh2 package was added to this list for completeness. The development package for libssh2 (libssh2-devel) as well as gcc (a C compiler) are required, since the process of installing Net::SSH2 from source requires a library to be built so that Net::SSH2 can talk to libssh2.
When Perl modules are installed from source, the module's test suite is run by default to check that everything is ok before actually running the install step. Hence, you will need to ensure that perl-Test-Simple is installed, since Net::SSH2 uses this to run its tests:
sudo yum install perl-Test-Simple
I personally find it much easier to install Perl modules via cpanm than cpan, thus I recommend installing it (it's available as a yum package):
sudo yum install perl-App-cpanminus
Now the installation of Net::SSH2 should be as simple as:
cpanm Net::SSH2
If you want to install the module system-wide, then you will need to prefix the cpanm call with sudo:
sudo cpanm Net::SSH2

Unable to install URI::Escape module in Perl v5.18.2 using cpan

I am using Perl v5.18.2 on an Ubuntu machine. Now I want to install URI::Escape module using cpan.
It throws this error message:
Can't exec "make": No such file or directory at
/usr/share/perl/5.18/CPAN/Distribution.pm line 2084.
I am running cpan with sudo permission.
So what's the problem?
make is installed, and isn't being found.
make isn't installed, and you need help installing it.
make isn't installed, and you don't think it should be used.
If it's the second case, you can use
sudo apt-get install make
You'll probably need the following too:
sudo apt-get install gcc
You may have a different flavour of make utility on your system, such as gmake (GNU Make), dmake or possibly bmake (BSD Make). I suggest you check to see what was used to build your perl executable by using this command line
perl -MConfig -E'say $Config{make}'
You need to install make. Use your package manager to search for it.
Build-essential and GCC was missing. Thanks .
It worked :)

Circos error: REQUIRED MODULE IS MISSING

I clearly have Clone in my list of Perl modules. Why am I getting this error?
I am running Perl 5.16 on Mac OS X v10.8 (Mountain Lion).
lraven$ cat run.out
*** REQUIRED MODULE IS MISSING ***
You are missing the Perl module Clone. Use CPAN to install it as described in this tutorial
http://www.circos.ca/documentation/tutorials/configuration/perl_and_modules
lraven$ instmodsh
Installed modules are:
App::cpanminus
Bundle::NetSNMP
Clone
Config::General
DBI
ExtUtils::MakeMaker
...
I have tried re-installing from a .tar file, but I get the error:
dyld: lazy symbol binding failed: Symbol not found: _Perl_Gthr_key_ptr
There are many questions online about this error, but few solutions...
I was getting the same error. Finally got things to work using the command.
sudo perl -MCPAN -e 'install Clone'
You may encounter some additional errors from missing Perl modules. In a few cases I could only install libraries from within the shell. These were (Font:TTF and Text::Format)
I installed these by running
sudo perl -MCPAN -e shell
>install Font:TTF
>install Text::Format

Installing Perl with Perlbrew

I am trying to install Perl version 5.19.2 or version 5.19.8 with perlbrew. I am using the following command to install:
perlbrew -v install perl-5.19.8 (or 5.19.2) -Dcc=gcc
Everytime no matter what version I am trying to install I keep getting the following error:
FatPacker error loading Devel/PatchPerl.pm (could be a perl installation issue?) at /Path/to/my/perl/bin/patchperl line 33687
I am not sure whats going on. I am not very experienced in Perl. If anyone can offer me some tips/help that will be great.
Thanks

How to install XML::Parser without expat-devel?

XML::Parser fails to build on a quite fresh 64-bit Debian box. After issuing cpan XML::Parser, cpan fails with lots of errors about Expat.c and Expat.xs:
[...]
Expat.xs:2182: error: ‘CallbackVector’ has no member named ‘skip_until’
Expat.c: In function ‘XS_XML__Parser__Expat_Do_External_Parse’:
Expat.c:2904: error: ‘XML_Parser’ undeclared (first use in this function)
Expat.c:2904: error: expected ‘;’ before ‘parser’
Expat.xs:2194: error: ‘parser’ undeclared (first use in this function)
make[1]: *** [Expat.o] Error 1
make[1]: Leaving directory `/root/.cpan/build/XML-Parser-2.41-rpV6ok/Expat'
make: *** [subdirs] Error 2
TODDR/XML-Parser-2.41.tar.gz
/usr/bin/make -- NOT OK
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Message at the start of the output explains that expat-devel is needed for building.
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'.
But expat-devel is not in Debian repository.
Is it possible to get over this without need to build/install expat from source?
The package you want to install is named libexpat1-dev. You could also just install libxml-parser-perl via apt-get. Or if you really want to install via CPAN try installing the Debian packages dependencies first via apt-get build-dep libxml-parser-perl.
libexpat1-dev contains both libexpat and expat.h, which are both mentioned in the message as well:
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
Installing libexpat1-dev seems to solve the problem:
$ aptitude install libexpat1-dev
There is always the manual method - to build/install expat from source.
(This example shows installing to an alternative location for XAMPP | LAMPP)
Download from:
http://sourceforge.net/projects/expat/files/expat/
tar zxf /[where-ever]/expat-2.1.0.tar.gz -C /tmp
cd /tmp/expat-2.1.0
/opt/lampp/bin/perl ./configure --prefix=/opt/lampp LDFLAGS=-L/opt/lampp/lib
make
make install
http://search.cpan.org - search for and download - XML::Parser
tar zxf /[where-ever]/XML-Parser-2.41.tar.gz -C /tmp
cd /tmp/XML-Parser-2.41
/opt/lampp/bin/perl ./Makefile.PL EXPATLIBPATH=/opt/lampp/lib EXPATINCPATH=/opt/lampp/include
make
make test
make install
Work like a charm in Ubuntu 15.04. The only thing that I need is install Perl XML Parser with:
sudo apt-get install libxml-parser-perl
And following the instructions here, I was able to import successfully all my ratings into Rhythmbox. Now, the only work that I need to do is create again the smart play lists, that is nothing compared with my entire libray ratings.
Today I had the same issue wanting to complile the new GIMP 2.9.4 beta on OSX 10.8 and the aid of homebrew.
First install perl
brew install perl
Then the XML::Parser module by going into the perl shell with
perl -MCPAN -e shell
And inside the shell install XML::Parser by typing
install XML::Parser
Exit shell
exit
Now, verify it has been installed successfully. If everything is ok, you will not see an error.
perl -e "require XML::Parser"
If the ./configure still fails missing XML::Parser, then intltools is not using the perl you have installed. Looking at the script tells me it does the test with $INTLTOOL_PERL -e "require XML::Parser". Trying a echo $INTLTOOL_PERL gave out nothing, so the magic is to set it with
export $INTLTOOL_PERL=perl
Now run ./configure again.
None of the above methods worked for me. I had the right environment variables setup but they were somehow not picked up by cpanm that I use to install perl modules. Expat was also installed.
Here is what I did to overcome the same problem that OP is reporting.
This is very close to what #LadyBuzz suggested.
Download the XML::Parser from cpan.org
Extract the tarball into directory and descend to it.
Open the Makefile.pl and edit the first lines to actually have the absolute paths to both: EXPATLIBPATH and EXPATINCPATH
Save the Makefile.pl, go up one level and create a new tarball with the Makefile.pl that you just edited.
Execute cpanm on the newly created tarball.
This resulted in successful installation of the module.