已成功安装OWLready2,但在使用过程中出现错误

时间:2019-06-18 11:43:37

标签: python owlready

如标题中所述,我已经更新“ 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的模块

1 个答案:

答案 0 :(得分:-1)

重新启动内核(python),它在jupyter笔记本Anaconda3中对我有用

owlready2 in jupyter notebook

in:
from owlready2 import *
onto = get_ontology("swo-inferred.owl").load()
onto.classes()

out:
<generator object _GraphManager.classes at 0x0000020371A9A848>