G-Node / python-odml

odML libraries
http://g-node.github.io/python-odml/
BSD 4-Clause "Original" or "Old" License
24 stars 30 forks source link

Dependency issues on setup install #410

Closed mpsonntag closed 3 years ago

mpsonntag commented 3 years ago

When installing the package using python setup.py install, the package can be installed and imported, but running the tests or using SPARQL specific features of odml results in an AttributeError:

----> 1 from rdflib.plugins import sparql

~/Chaos/software/miniconda3/envs/py38/lib/python3.8/site-packages/rdflib/plugins/sparql/__init__.py in <module>
     33 
     34 
---> 35 from . import parser
     36 from . import operators
     37 from . import parserutils

~/Chaos/software/miniconda3/envs/py38/lib/python3.8/site-packages/rdflib/plugins/sparql/parser.py in <module>
    180 # [140] PNAME_NS ::= PN_PREFIX? ':'
    181 PNAME_NS = Optional(
--> 182     Param('prefix', PN_PREFIX)) + Suppress(':').leaveWhitespace()
    183 
    184 # [173] PN_LOCAL_ESC ::= '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' )

~/Chaos/software/miniconda3/envs/py38/lib/python3.8/site-packages/rdflib/plugins/sparql/parserutils.py in __init__(self, name, expr, isList)
    111     """
    112     def __init__(self, name, expr, isList=False):
--> 113         self.name = name
    114         self.isList = isList
    115         TokenConverter.__init__(self, expr)

AttributeError: can't set attribute

This is due to the fact, that setup.py install in comparison to pip install pulls down pre-releases as well. In this case it pulls down a pre-release of the pyparsing package, that currently elicits the above described error.

To make sure odml is correctly installed independent of installation method, the version of pyparsing needs to be pinned to version 2.4.7 until this issue is resolved.