V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
builg
V2EX  ›  Python

关于 chatterbot 创建实例出现的问题

  •  
  •   builg · 2017-04-30 12:38:29 +08:00 via Android · 3281 次点击
    这是一个创建于 2773 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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



    到底是什么原因啊,而且如何解决这个问题?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2935 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 00:31 · PVG 08:31 · LAX 16:31 · JFK 19:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.