Syntax error in owlready

classic Classic list List threaded Threaded
2 messages Options
PY
Reply | Threaded
Open this post in threaded view
|

Syntax error in owlready

PY
I got the following error. Does anybody know what is wrong? Thanks.

$ pip install owlready
Requirement already satisfied: owlready in /usr/local/lib/python2.7/site-packages
$ cat main.py
#!/usr/bin/env python
# vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8:

from owlready import *
onto_path.append('/path/to/your/local/ontology/repository')
onto = get_ontology('http://www.lesfleursdunormal.fr/static/_downloads/pizza_onto.owl')
onto.load()
$ ./main.py
Traceback (most recent call last):
  File "./main.py", line 4, in <module>
    from owlready import *
  File "/usr/local/lib/python2.7/site-packages/owlready/__init__.py", line 154
    def __init__(self, *Entities, ontology = None):
                                         ^
SyntaxError: invalid syntax
Reply | Threaded
Open this post in threaded view
|

Re: Syntax error in owlready

Jiba
Administrator
Hello,

You need Python 3 for Owlready, not Python 2.

In addition, you are installing Owlready 1; I recommend using version 2 (pip3 install owlready2).

Kind regards,
Jean-Baptiste