python - 成功安装OWLready2,但使用时出错
问题描述
正如标题中提到的,我已经将“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 的模块
解决方案
重新启动内核(python),它适用于 jupyter notebook Anaconda3
in:
from owlready2 import *
onto = get_ontology("swo-inferred.owl").load()
onto.classes()
out:
<generator object _GraphManager.classes at 0x0000020371A9A848>
推荐阅读
- azure - 通过 Azure Pipelines 将 Spring Boot App 部署到 Azure App Service
- visual-studio - 如何为每个循环的每个实例进行变量更新?
- python - Python如何循环多个变量
- java - 如何检查 SpringBoot Hibernate/JPA 中的高级查询?
- php - SoapFault - 函数(“function_name”)不是此服务的有效方法 - Magento 1.9
- prometheus - 如何将 apache-ignite 指标导出到 sql/jmx
- javascript - Javascript文件未链接到PHP文件
- python - TypeError: ‘module’ object is not callable error with ChromeDriver and Chrome using Selenium on macos
- javascript - async await 在 setTimeout 里面 forEach
- html - 如何使用隐藏形式更改布尔值?