错误:“AttributeError: module 'aiml' has no attribute 'Kernel'
C:\Users\lenovo\PycharmProjects\aimltest\venv\Scripts\python.exe C:/Users/lenovo/PycharmProjects/aimltest/test1.py
Traceback (most recent call last):
File "C:/Users/lenovo/PycharmProjects/aimltest/test1.py", line 17, in <module>
alice=aiml.Kernel()
AttributeError: module 'aiml' has no attribute 'Kernel'
C:\Users\lenovo\PycharmProjects\aimltest\venv\lib\site-packages\aiml\alice
Process finished with exit code 1
检查了目录,aiml下面也有Kernel.py,请问如何解决,谢谢大侠!
-----------------------源代码------------------------------------
# -*- coding: utf-8 -*-
import aiml
import sys
import os
def get_module_dir (name):
path = getattr(sys.modules[name], '__file__', None)
if not path:
raise AttributeError('模块 %s 没有 属性 __file__'%name)
return os.path.dirname(os.path.abspath(path))
alice_path =get_module_dir('aiml') +'\\alice'
os.chdir(alice_path)
print(alice_path)
alice=aiml.Kernel()
alice.learn("std-startup.xml")
alice.respond("load aiml b")
while True:
print(alice.respond(input("Enter your message >>")))
相关推荐
一个NVIDIA驱动安装报错——ERROR: The nvidia kernel module was not created.
Ubuntu18系统下,在安装cuda及nvidia驱动时,安装失败,查看日志显示“ERROR: The nvidia kernel module was not created.” 指令如下: sudo ./cuda_10.1.168_418.67_linux.run 解决办法: nvidia内核模块没有被创建,查看内核 终端输入: uname -r 输出:5.3.0-28-generic 由于在使用sudo apt-get updatesudo apt-get upgrade 时会造成内核版本升级,导致以前下载的驱动文件已经不适配了,我的解决方案是,到NVIDIA官网下载最新版本的驱动
Anoconda虚拟环境下打开jupyter notebook出现The kernel has died, and the automatic restart has failed的解决办法
原创链接(转载请注明出处):https://blog.csdn.net/qq_44091004/article/details/105684698 激活虚拟环境,启动jupyter notebook 1.打开cmd,输入activate name(你的虚拟环境的名字) 2.输入jupyter notebook后会打开jupyter notebook 可能会出现kernel died的问题。 解决办法 1.重新打开cmd ,输入jupyter kernelspec list,查看你的jupyter里有几个kernel,一般如果没额外安装过,会只显示一个path。 2.再次激活虚拟环境(activ
解决On no!Something has gone wrong.
解决On no!Something has gone wrong.
linux kernel Module Programming
linux内核编程,内核编程的注意事项,内核调试方法
Linux vmware-workstation 15.5.1.15018445 (Pro & Full)的VMware Kernel Module Updater问题解决方法!!!
如果你在VNware官网下载了VMware-Workstation-Full-15.5.1-15018445.x86_64.bundle 安装以后打VMware-Workstation-15.5.1 显示如下图所示: 那么你可能需要做以下修改才能顺利进入软件 步骤如下: 查看已安装VMware的版本 vmware-installer -l 到Github-mkubecek-Vmware克隆Vmware社区补丁 方法是vmaware-install -l 获取到版本信息后,只取vmware后面的代码(字母) 比如我的是vmware-workstation 15.5.1



