我正在使用 ChatterBot 库创建一个聊天机器人,但我遇到了这个错误。我试图在我的程序中创建一个聊天机器人对象,但我得到了这个编译时错误
Traceback (most recent call last):
File "d:\TwitterBot1\Bot1.py", line 123, in <module>
bot = ChatBot('Bot1')
File "D:\Python\lib\site-packages\chatterbot\chatterbot.py", line 34, in __init__
self.storage = utils.initialize_class(storage_adapter, **kwargs)
File "D:\Python\lib\site-packages\chatterbot\utils.py", line 54, in initialize_class
return Class(*args, **kwargs)
File "D:\Python\lib\site-packages\chatterbot\storage\sql_storage.py", line 22, in __init__
from sqlalchemy import create_engine
File "D:\Python\lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
from . import util as _util # noqa
ImportError: cannot import name 'util' from partially initialized module 'sqlalchemy' (most likely due to a circular import) (D:\Python\lib\site-packages\sqlalchemy\__init__.py)
我查看了错误中的文件,问题出在此导入行
from . import util as _util # noqa
当我尝试运行__init__.py
文件时,出现此错误
Traceback (most recent call last):
File "d:\Python\Lib\site-packages\sqlalchemy\__init__.py", line 8, in <module>
from . import util as _util # noqa
ImportError: attempted relative import with no known parent package
文件中的所有其他导入在__init__.py
“。”之后都有一些文件指令。遵循“从”指令。我不确定这个文件是否缺少某些指令或什么。
谁能指出我的修复方向?