Yale-LILY/SummEval

Unable to import the package

29riyasaxena opened this issue · 2 comments

I am unable to import the package into google colab and download it to my local computer. It raises the following error while importing it into google colab:

KeyError: 'ROUGE_HOME'

During handling of the above exception, another exception occurred:

NameError                                 Traceback (most recent call last)
[/usr/local/lib/python3.7/dist-packages/summ_eval/rouge_metric.py](https://localhost:8080/#) in <module>
     23     print(f'Please run the following command and add it to your startup script: \n export ROUGE_HOME={os.path.join(dirname, "ROUGE-1.5.5/")}')
     24     print(f'Please also run this command: \n pip install -U  git+https://github.com/bheinzerling/pyrouge.git')
---> 25     exit()
     26 
     27 @gin.configurable

NameError: name 'exit' is not defined

Hi, I got the same import error, and got past it.

I installed SummEval and PyRouge as follows:

pip install summ-eval
export ROUGE_HOME=/home/local/KHQ/cameron.johnson/anaconda3/envs/py38/lib/python3.8/site-packages/summ_eval/ROUGE-1.5.5/
pip install -U  git+https://github.com/bheinzerling/pyrouge.git

Then when I ran (in a new terminal window, without running the above export command first!):

from summ_eval.rouge_metric import RougeMetric

I got the following traceback:

KeyError                                  Traceback (most recent call last)
File ~/anaconda3/envs/py38/lib/python3.8/site-packages/summ_eval/rouge_metric.py:12, in <module>
     11 try:
---> 12     ROUGE_HOME = os.environ['ROUGE_HOME']
     13     from pyrouge import Rouge155

File ~/anaconda3/envs/py38/lib/python3.8/os.py:675, in _Environ.__getitem__(self, key)
    673 except KeyError:
    674     # raise KeyError with the original key value
--> 675     raise KeyError(key) from None
    676 return self.decodevalue(value)

KeyError: 'ROUGE_HOME'

During handling of the above exception, another exception occurred:

NameError                                 Traceback (most recent call last)
Input In [15], in <cell line: 1>()
----> 1 from summ_eval.rouge_metric import RougeMetric

File ~/anaconda3/envs/py38/lib/python3.8/site-packages/summ_eval/rouge_metric.py:25, in <module>
     23     print(f'Please run the following command and add it to your startup script: \n export ROUGE_HOME={os.path.join(dirname, "ROUGE-1.5.5/")}')
     24     print(f'Please also run this command: \n pip install -U  git+https://github.com/bheinzerling/pyrouge.git')
---> 25     exit()
     27 @gin.configurable
     28 class RougeMetric(Metric):
     29     def __init__(self, rouge_dir=ROUGE_HOME, rouge_args=None, verbose=False):

NameError: name 'exit' is not defined

Then in the same terminal, I ran the export command:

export ROUGE_HOME=/home/local/KHQ/cameron.johnson/anaconda3/envs/py38/lib/python3.8/site-packages/summ_eval/ROUGE-1.5.5/

...and then I got to a new error!

In [1]: from summ_eval.rouge_metric import RougeMetric
Preparing ROUGE Perl script - this will take a few seconds
mv: cannot stat 'Yale-LILY-SummEval-7e4330d/evaluation/summ_eval/ROUGE-1.5.5/': No such file or directory

I am having this same error. Is there a solution:

In [1]: from summ_eval.rouge_metric import RougeMetric
Preparing ROUGE Perl script - this will take a few seconds
mv: cannot stat 'Yale-LILY-SummEval-7e4330d/evaluation/summ_eval/ROUGE-1.5.5/': No such file or directory