python - 导入错误: No module named 'Kernel'

标签 python window kernel chatbot aiml

我正在使用 Windows 10 并正在开发一个聊天机器人项目,并使用与 Python 集成的 AIML 我收到此错误

import aiml
File"C:\Python34\lib\site-packages\aiml\__init__.py", line 4, in <module>  
from Kernel import Kernel  
ImportError: No module named 'Kernel'

在此处运行集成代码时

 import aiml

    # Create the kernel and learn AIML files 
      kernel = aiml.Kernel() 
      kernel.learn("std-startup.xml") 
      kernel.respond("load aiml b")    
    # Press CTRL-C to break this loop while True:
      print (kernel.respond(raw_input("Enter your message >> ")))

我的aml目录包含文件__init__.py 这是它的内容

__all__ = []

# The Kernel class is the only class most implementations should need. 
  from Kernel import Kernel

文件内核也存在..那么问题是什么?

最佳答案

我查看了代码并在本地进行了测试,aiml 模块目前似乎不支持 Python 3,但在 Python 2.7 中加载得很好。

安装Python 2.7事情应该对你来说会更好。

关于python - 导入错误: No module named 'Kernel' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33971517/

相关文章:

python - 在python中找到两个kde图之间的非重叠区域

C# geckoFX(AutoJSContext 不工作)

通过 vsyscall 页面的 Linux 系统调用策略

linux - 将CPU频率指定为引导时Linux的内核CMD_LINE参数?

python - 使用 lambda 函数的列表理解

python - 在 Azure 中运行多个 Python 脚本(使用 Docker?)

python - Python 版本行是什么意思?

angularjs - 带有模板参数属性的 Angular 谷歌地图窗口指令

rust - 如何使用 winit rust crate 中的 raw_window_handle() 方法?

linux - OS如何限制用户进程访问内核内存