Closed wasiahmad closed 6 years ago
It seems like you installed the module before running setup_rouge.py
.
Check installation guide https://github.com/pltrdy/files2rouge#getting-started
I exactly followed the guide. First, install pyrouge using the command provided and then the repo is cloned and the required commands are executed. But still the error persists and it appears when I try to execute files2rouge
with the reference and summary files.
cd
in your files2rouge
root folderls files2rouge | grep "settings.json"
i. there is nothing: set ROUGE settings with ./setup_rouge.py
and set an empty path (you will get an error if the path exists)
ii. their is a settings.json
file: reinstall the module: pip install -U .
(note the .
is part of the command).python -c "import files2rouge; f = files2rouge.Settings(); f._load(); print(f.data)"
It must not raise error and return some paths.
I followed your instruction and I get the following when I check the installation.
{'ROUGE_path': '/home/wasiahmad/.files2rouge/ROUGE-1.5.5.pl', 'ROUGE_data': '/home/wasiahmad/.files2rouge/data'}
But when I run the files2rouge
command as follows with the summary and reference files, it is still giving the same error.
files2rouge data/model_summaries/predicted_summary.txt data/system_summaries/test.txt.tgt.tagged
which python
files2rouge
module path: python -c "import files2rouge; print(files2rouge)"
files2rouge
command path: which files2rouge
files2rouge
command code: cat $(which files2rouge)
~/software/anaconda3/bin/python
<module 'files2rouge' from '/home/wasiahmad/software/anaconda3/lib/python3.6/site-packages/files2rouge-2.0.0-py3.6.egg/files2rouge/init.py'>
~/software/anaconda3/bin/files2rouge
#!/home/wasiahmad/software/anaconda3/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'files2rouge==2.0.0','console_scripts','files2rouge'
__requires__ = 'files2rouge==2.0.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('files2rouge==2.0.0', 'console_scripts', 'files2rouge')()
)
It's really strange. It does not make sense that:
python -c "import files2rouge; f = files2rouge.Settings(); f._load(); print(f.data)"
works but the files2rouge
command does not, since we precisely test the step that may cause troubles.
I'm running out of idea to be honnest, maybe could you check permissions: ls -l /home/wasiahmad/software/anaconda3/lib/python3.6/site-packages/files2rouge/
Same bug if anyone has ideas. Maybe has to do with $PATH/anaconda?
@sshleifer try to install in the folder using:
cd files2rouge
pip install -U -e .
That fails with some other error
FileNotFoundError: [Errno 2] No such file or directory: '/Users/shleifer/miniconda3/envs/nb/lib/python3.7/site-packages/files2rouge-2.1.0-py3.7.egg'
But all is well, I got it working in python. Thanks for the help!
Getting the following error when trying to use files2rouge.
Can't load ROUGE settings in '/home/wasiahmad/software/anaconda3/lib/python3.6/site-packages/files2rouge/settings.json'. Check that the file exists or initialize it with 'setup_rouge.py'
How to solve the error?