我正在尝试使用此指南运行chatterbot示例:http://chatterbot.readthedocs.io/en/stable/tutorial.html

所以我收到此导入错误:

➜  examples git:(master) python basic_example.py
Traceback (most recent call last):
  File "basic_example.py", line 2, in <module>
    from chatterbot import ChatBot
  File "/Library/Python/2.7/site-packages/chatterbot/__init__.py", line 4, in <module>
    from .chatterbot import ChatBot
  File "/Library/Python/2.7/site-packages/chatterbot/chatterbot.py", line 4, in <module>
    from .logic import MultiLogicAdapter
  File "/Library/Python/2.7/site-packages/chatterbot/logic/__init__.py", line 1, in <module>
    from .logic_adapter import LogicAdapter
  File "/Library/Python/2.7/site-packages/chatterbot/logic/logic_adapter.py", line 3, in <module>
    from chatterbot.utils import import_module
ImportError: cannot import name import_module


有什么帮助吗?

最佳答案

转到:/Library/Python/2.7/site-packages/chatterbot/

如果看到名为utils的目录,请将其删除。

另外,如果看到名为adapters的目录,请将其删除。

他们在这里谈论这个问题ImportError: cannot import name 'import_module'

10-08 15:58