from chatterbot import ChatBot
chatbot = ChatBot('love')
执行上面的代码时会出错:
C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\chatterbot\storage\jsonfile.py:26: UnsuitableForProductionWarning: The JsonFileStorageAdapter is not recommended for production environments.
self.UnsuitableForProductionWarning
Traceback (most recent call last):
File "E:\Python\Python 代码\practice.py", line 4, in <module>
chatbot = ChatBot('love')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\chatterbot\chatterbot.py", line 83, in __init__
self.initialize()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\chatterbot\chatterbot.py", line 93, in initialize
nltk_download_corpus('corpora/wordnet')
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\chatterbot\utils.py", line 118, in nltk_download_corpus
find(resource_path)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\nltk\data.py", line 635, in find
return find(modified_name, paths)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\nltk\data.py", line 621, in find
return ZipFilePathPointer(p, zipentry)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\nltk\compat.py", line 366, in _decorator
return init_func(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\nltk\data.py", line 470, in __init__
zipfile = OpenOnDemandZipFile(os.path.abspath(zipfile))
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\nltk\compat.py", line 366, in _decorator
return init_func(*args, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\nltk\data.py", line 986, in __init__
zipfile.ZipFile.__init__(self, filename)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\zipfile.py", line 1026, in __init__
self._RealGetContents()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\zipfile.py", line 1093, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
到底是什么原因啊,而且如何解决这个问题?