ImportError: No module named db when using chatterbot
ImportError: No module named db when using chatterbot
我正在尝试构建一个聊天机器人。所以我安装了 chatterbot 包。
python 代码如下:
from chatterbot import TalkWithCleverbot
talk = TalkWithCleverbot()
talk.begin()
但我收到以下错误:
Traceback (most recent call last):
File "C:\Users\JERIN\Desktop\bottobot.py", line 2, in <module>
talk = TalkWithCleverbot()
File "C:\Python27\lib\site-packages\chatterbot\__init__.py", line 157, in __init__
super(TalkWithCleverbot, self).__init__()
File "C:\Python27\lib\site-packages\chatterbot\__init__.py", line 4, in __init__
from jsondb.db import Database
ImportError: No module named db
我尝试安装 jsondb 和 db 包,但没有用。请帮助我
您的错误突出了问题 -- 没有 db
对象可从 jsondb
导入以用于 __init__.py
.
中的调用
def __init__(self, name="bot", logging=True):
from jsondb.db import Database
^^ this doesn't exist
我找到了 'ChatterBot' module on GitHub and it appears that the 'jsondb' that the author is importing is not the one you'd get if you installed from pip. Instead, the author is expecting you to use his jsondb module that can be found on GitHub.
的来源
您可以通过卸载从 pip 检索到的 jsondb 来解决此问题:
pip uninstall jsondb
并安装 ChatterBot 作者的 jsondb 模块:
pip install git+https://github.com/gunthercox/jsondb.git
你 运行 进入这个错误是因为 ChatterBot 作者假设你安装了 他的包 命名为 jsondb 并且没有以典型方式包含依赖项。
我正在尝试构建一个聊天机器人。所以我安装了 chatterbot 包。 python 代码如下:
from chatterbot import TalkWithCleverbot
talk = TalkWithCleverbot()
talk.begin()
但我收到以下错误:
Traceback (most recent call last):
File "C:\Users\JERIN\Desktop\bottobot.py", line 2, in <module>
talk = TalkWithCleverbot()
File "C:\Python27\lib\site-packages\chatterbot\__init__.py", line 157, in __init__
super(TalkWithCleverbot, self).__init__()
File "C:\Python27\lib\site-packages\chatterbot\__init__.py", line 4, in __init__
from jsondb.db import Database
ImportError: No module named db
我尝试安装 jsondb 和 db 包,但没有用。请帮助我
您的错误突出了问题 -- 没有 db
对象可从 jsondb
导入以用于 __init__.py
.
def __init__(self, name="bot", logging=True):
from jsondb.db import Database
^^ this doesn't exist
我找到了 'ChatterBot' module on GitHub and it appears that the 'jsondb' that the author is importing is not the one you'd get if you installed from pip. Instead, the author is expecting you to use his jsondb module that can be found on GitHub.
的来源您可以通过卸载从 pip 检索到的 jsondb 来解决此问题:
pip uninstall jsondb
并安装 ChatterBot 作者的 jsondb 模块:
pip install git+https://github.com/gunthercox/jsondb.git
你 运行 进入这个错误是因为 ChatterBot 作者假设你安装了 他的包 命名为 jsondb 并且没有以典型方式包含依赖项。