pltrdy / files2rouge

Calculating ROUGE score between two files (line-by-line)
MIT License
191 stars 53 forks source link

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

Open cgebe opened 6 years ago

cgebe commented 6 years ago

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 commented 6 years ago

Solution:

$ apt-get install -y cpanminus
$ cpanm --force XML::Parser
coree commented 5 years ago

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.

sshleifer commented 4 years ago

is there a mac equivalent?

pltrdy commented 4 years ago

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

markusdr commented 4 years ago

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)"
wentinghome commented 4 years ago

Is there a Windows equivalent?

pltrdy commented 4 years ago

@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
kaushal0494 commented 3 years ago

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!