Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法将Owlready库导入Python_Python_Ontology_Owlready - Fatal编程技术网

无法将Owlready库导入Python

无法将Owlready库导入Python,python,ontology,owlready,Python,Ontology,Owlready,我是Python的初学者。我正在使用。我已经在PyCharm IDE上安装了owlready库,但是在python代码中导入owlready存在问题。我尝试了owlready import*中的,就像文档中一样,但它总是给我: Traceback (most recent call last): File "C:/Users/siekoo/OneDrive/Development/python/NER/onto_start.py", line 1, in <module>

我是Python的初学者。我正在使用。我已经在PyCharm IDE上安装了
owlready
库,但是在python代码中导入
owlready
存在问题。我尝试了owlready import*中的
,就像文档中一样,但它总是给我:

Traceback (most recent call last):
  File "C:/Users/siekoo/OneDrive/Development/python/NER/onto_start.py", line 1, in <module>
    from owlready import *
  File "C:\winpython\python-2.7.10.amd64\lib\site-packages\owlready\__init__.py", line 85
    def __init__(self, *Entities, ontology = None):
                                         ^
SyntaxError: invalid syntax
回溯(最近一次呼叫最后一次):
文件“C:/Users/siekoo/OneDrive/Development/python/NER/onto_start.py”,第1行,在
从owlready导入*
文件“C:\winpython\python-2.7.10.amd64\lib\site packages\owlready\ \uuuu init\uuuu.py”,第85行
定义初始化(self,*实体,本体=None):
^
SyntaxError:无效语法

在您使用Python2时,Owlready似乎适用于Python3。更改python版本以使其正常工作

无效语法错误是因为新的Python 3参数列表,请参阅: