files2rouge
files2rouge copied to clipboard
ROUGE-1.5.5.pl - XML::Parser dependency error
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
Solution:
$ apt-get install -y cpanminus
$ cpanm --force XML::Parser
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.
is there a mac equivalent?
@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
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)"
Is there a Windows equivalent?
@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
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!