Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import the package #39

Open
29riyasaxena opened this issue Oct 2, 2022 · 2 comments
Open

Unable to import the package #39

29riyasaxena opened this issue Oct 2, 2022 · 2 comments

Comments

@29riyasaxena
Copy link

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
@cameron-a-johnson
Copy link

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

@jsl5710
Copy link

jsl5710 commented Jul 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants