Install & Compatibility
Where this runs
tested against v0.9.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 2.280s · 32.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.0s · import 2.170s · 34MB
32MB installed
● package 32MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ShExEvaluator
✓ from pyshex import ShExEvaluator
✗ from pyshex.evaluator import ShExEvaluator
ShExEvaluator moved to top-level in 0.7.x
ShexMaker
✓ from pyshex import ShexMaker
Basic usage: parse an RDF graph, define a ShEx schema, and evaluate whether a node conforms.
from pyshex import ShExEvaluator
from rdflib import Graph
g = Graph()
g.parse("example.ttl", format="turtle")
shapes = """PREFIX ex: <http://example.org/>
ex:UserShape {
ex:name xsd:string ;
ex:age xsd:integer
}"""
evaluator = ShExEvaluator(rdf_graph=g, schema=shapes, focus="http://example.org/user1")
result = evaluator.evaluate()
print(result)
pyshex --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'antlr4'
ANTLR runtime is missing or wrong version.
fixpip install 'antlr4-python3-runtime==4.9'
AttributeError: 'Graph' object has no attribute 'triples'
rdflib 5+ changed the API; use 'g.triples((s,p,o))' instead of g.triples.
fixReplace g.triples(...) with g.triples((subject, predicate, object))
ImportError: cannot import name 'ShExEvaluator' from 'pyshex.evaluator'
Import path changed; ShExEvaluator is now at pyshex directly.
fixUse: from pyshex import ShExEvaluator
ValueError: Missing 'schema' parameter
ShExEvaluator requires 'schema' and 'rdf_graph' as keyword arguments.
fixCall as ShExEvaluator(rdf_graph=..., schema=..., focus=...)
Upgrade
Version history
0.9.0latest on PyPI · released May 7, 2026
Audit
Dependencies
rdflibrequiredRequired for RDF graph manipulation
antlr4-python3-runtimerequiredUsed for parsing ShEx schemas