如标题中所述,我已经更新了“ Python” 和“ pip” 到它们的最后一个版本,并且成功了已安装 “ owlready2” 库,但是在以下代码中使用它时:
from owlready2 import *
onto_path.append("path to onto in my local windows system- not linux")
onto= get_ontology("nif.owl")
onto.load()
Python给我以下错误:
Blockquote ModuleNotFoundError:没有名为owlready2的模块
答案 0 :(得分:-1)
重新启动内核(python),它在jupyter笔记本Anaconda3中对我有用
in:
from owlready2 import *
onto = get_ontology("swo-inferred.owl").load()
onto.classes()
out:
<generator object _GraphManager.classes at 0x0000020371A9A848>