from chatterbot import ChatBot
bot = ChatBot("The Royal Zhao")
给出错误
File "/Users/michaelchary/Documents/GitHub/yalebot/flaskbot.py", line 8, in <module>
bot = ChatBot("The Royal Zhao")
File "/usr/local/lib/python3.9/site-packages/ChatterBot-1.1.0a7-py3.9.egg/chatterbot/chatterbot.py", line 28, in __init__
File "/usr/local/lib/python3.9/site-packages/ChatterBot-1.1.0a7-py3.9.egg/chatterbot/utils.py", line 33, in initialize_class
File "/usr/local/lib/python3.9/site-packages/ChatterBot-1.1.0a7-py3.9.egg/chatterbot/storage/sql_storage.py", line 46, in __init__
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/dialects/sqlite/base.py", line 2009, in has_table
self._ensure_has_table_connection(connection)
File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 341, in _ensure_has_table_connection
raise exc.ArgumentError(
sqlalchemy.exc.ArgumentError: The argument passed to Dialect.has_table() should be a <class 'sqlalchemy.engine.base.Connection'>, got <class 'sqlalchemy.engine.base.Engine'>. Additionally, the Dialect.has_table() method is for internal dialect use only; please use ``inspect(some_engine).has_table(<tablename>>)`` for public API use.
由于 PyYAML、Spacy、Python 3.9.1(我的版本)之间不兼容,我通过克隆存储库安装了 chatterbot (v1.1) 和 chatterbot-corpus (v1.2.0)。
我有 SQL Alchemcy v1.4.13。
我的操作系统是 10.15.7(Mac、Catalina)。
无论我是否启动了 SQL 服务器(通过 brew services start mysql
),错误都不会改变。文本字符串的内容没有影响(例如,空格或下划线无关紧要)。
我无法在线报告此错误。这似乎不是安装 chatterbot
时的常见错误。
更新 MongoDatabaseAdapter
没有错误,表明问题在于 SQL
和 chatterbot
之间的链接。