2017-01-01 263 views
1

我已經安裝使用pyrougepip install pyrouge如何完全安裝pyrouge?

和CMD:C://python27/scripts/pip install pyrouge

但這還不夠。我發現我應該使用另一個:pyrough_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory然後。

我不知道如何使用它和在哪裏(無論是在C://python27/scripts/或其他地方)而不是/absolute/path/to/ROUGE-1.5.5/directory,我應該寫什麼。

任何人都可以幫助我嗎? 謝謝 是的,我是管理員。錯誤是:

>>> from pyrouge import Rouge155 

>>> r = Rouge155() 

Traceback (most recent call last): 

File "<pyshell#1>", line 1, in <module> 

r = Rouge155() 

File "C:\Python34\lib\site-packages\pyrouge\Rouge155.py", line 88, in   
__init__ 
self.__set_rouge_dir(rouge_dir) 
File "C:\Python34\lib\site-packages\pyrouge\Rouge155.py", line 402, in _ 
_set_rouge_dir 
self._home_dir = self.__get_rouge_home_dir_from_settings() 
File "C:\Python34\lib\site-packages\pyrouge\Rouge155.py", line 418, in 
__get_rouge_home_dir_from_settings 
config.read_file(f) 
File "C:\Python34\lib\configparser.py", line 691, in read_file 
self._read(f, source) 
File "C:\Python34\lib\configparser.py", line 1058, in _read 
raise MissingSectionHeaderError(fpname, lineno, line) 
configparser.MissingSectionHeaderError: File contains no section headers. 
file: 'C:\\Users\\sara\\AppData\\Roaming\\pyrouge\\settings.ini', line: 5 
'<!DOCTYPE html>\n' 

我發現 「pyrough_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory」 上: https://pypi.python.org/pypi/pyrouge/0.1.0

+0

你上哪兒去找到這/你爲什麼認爲這個需要? – frlan

+0

你能發佈錯誤嗎?你是否以管理員身份運行?在Windows中,以管理員**的身份打開** cmd,讓我知道。 – Jordon

回答

0

本傑明·海因策幫助了我,他的解決方案的工作。 r = Rouge155() 使用 r = Rouge155('C://RELEASE-1.5.5') 而C://RELEASE-1.5.5是ROUGE-1.5.5路徑,而我的是C ://RELEASE-1.5.5

0

不受約束的方法output_to_dict()必須與Rouge155例如被稱爲第一個參數(代替了實例instancemethod)