2

I'm using windows 10 and working on a chatbot project and use aiml integrated with python I got this error

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

when running the integration code here

 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 >> ")))

and my aiml directory contains the file__init__.py here's it's content

__all__ = []

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

also file Kernel exists .. so what is the problem ?

user3625558
  • 31
  • 1
  • 2
  • You can use python --version to check the default python version. You can refer this [post](http://stackoverflow.com/q/43954498/6521116) for more. – LF00 May 13 '17 at 15:22

2 Answers2

3

I've had a look at the code and tested it locally, and the aiml module seemingly does not currently support Python 3, but loads perfectly fine in Python 2.7.

Install Python 2.7 and things should work a lot better for you.

Brendan Molloy
  • 1,784
  • 14
  • 22
3

Try to install python-aiml

  pip install python-aiml

It is an updated version and therefore it should work fine.

Justin Lange
  • 897
  • 10
  • 25