files2rouge icon indicating copy to clipboard operation
files2rouge copied to clipboard

ROUGE-1.5.5.pl - XML::Parser dependency error

Open cgebe opened this issue 6 years ago • 8 comments

ROUGE-1.5.5.pl has a XML::Parser dependency, without this module installed, the following error is printed:

Can't locate XML/Parser.pm in @INC (you may need to install the XML::Parser module) (@INC contains: /root/.files2rouge /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /root/.files2rouge/XML/DOM.pm line 41.
BEGIN failed--compilation aborted at /root/.files2rouge/XML/DOM.pm line 70.
Compilation failed in require at /root/.files2rouge/ROUGE-1.5.5.pl line 177.
BEGIN failed--compilation aborted at /root/.files2rouge/ROUGE-1.5.5.pl line 177.
Traceback (most recent call last):
  File "/usr/local/bin/files2rouge", line 11, in <module>
    load_entry_point('files2rouge==2.0.0', 'console_scripts', 'files2rouge')()
  File "/usr/local/lib/python3.6/site-packages/files2rouge-2.0.0-py3.6.egg/files2rouge/files2rouge.py", line 81, in main
    output = r.convert_and_evaluate(rouge_args=rouge_args_str)
  File "/usr/local/lib/python3.6/site-packages/pyrouge/Rouge155.py", line 361, in convert_and_evaluate
    rouge_output = self.evaluate(system_id, rouge_args)
  File "/usr/local/lib/python3.6/site-packages/pyrouge/Rouge155.py", line 336, in evaluate
    rouge_output = check_output(command).decode("UTF-8")
  File "/usr/local/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/local/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/root/.files2rouge/ROUGE-1.5.5.pl', '-e', '/root/.files2rouge/data', '-c', '95', '-r', '1000', '-n', '2', '-a', '-m', '/tmp/tmp9qlzfbsc/rouge_conf.xml']' returned non-zero exit status 2.

Probably good to mention in the README

cgebe avatar Apr 28 '18 14:04 cgebe

Solution:

$ apt-get install -y cpanminus
$ cpanm --force XML::Parser

cgebe avatar Apr 28 '18 15:04 cgebe

For me the command sudo apt-get install libxml-parser-perl worked. However, the parser was not installed in my case and cpanminus didn't worked.

coree avatar Mar 15 '19 04:03 coree

is there a mac equivalent?

sshleifer avatar Mar 03 '20 04:03 sshleifer

@sshleifer I'm not a Mac user but I would guess:

  • install xml stuff brew install libxml2
  • get perl/cpanminus http://www.cpan.org/modules/INSTALL.html
  • cpanm --force XML::Parser

pltrdy avatar Mar 03 '20 09:03 pltrdy

On systems with yum, this works well:

sudo yum install -y "perl(XML::LibXML)"

See also: https://grantm.github.io/perl-libxml-by-example/installation.html

And, for good measure, to avoid another common error:

sudo yum install -y "perl(DB_File)"

markusdr avatar May 27 '20 05:05 markusdr

Is there a Windows equivalent?

wentinghome avatar Jun 22 '20 22:06 wentinghome

@wentinghome I'm not using Windows.

However, it seems like you may install perl with either strawberry or activestate (see https://grantm.github.io/perl-libxml-by-example/installation.html#installing-on-windows) so you can:

# strawberry
cpan XML::LibXML

# active state
ppm install XML::LibXML

pltrdy avatar Jul 16 '20 09:07 pltrdy

how to resolve this problem without using sudo in for Ubuntu? I am having a hard time. If someone can help that will be great!

kaushal0494 avatar Dec 30 '20 10:12 kaushal0494