Skip to main content

Troubleshooting QWED-Legal

Installation Issuesโ€‹

Z3 Solver Not Foundโ€‹

Error:

ImportError: No module named 'z3'

Solution:

pip install z3-solver

Note: The package is z3-solver, not z3.

Holidays Package Versionโ€‹

Error:

AttributeError: module 'holidays' has no attribute 'country_holidays'

Solution:

pip install --upgrade holidays>=0.40

DeadlineGuard Issuesโ€‹

Unexpected Holiday Calculationโ€‹

Problem: Deadline seems off by a few days.

Cause: Different jurisdictions have different holidays.

Solution:

# Be explicit about jurisdiction
guard = DeadlineGuard(country="US", state="CA") # California holidays
guard = DeadlineGuard(country="GB") # UK holidays
guard = DeadlineGuard(country="IN") # India holidays

"Failed to parse dates" Errorโ€‹

Problem:

Failed to parse dates: Unknown string format

Solution: Use ISO format or unambiguous dates:

# โœ… Good
guard.verify("2026-01-15", "30 days", "2026-02-14")

# โŒ Bad (ambiguous)
guard.verify("01/02/2026", ...) # Is this Jan 2 or Feb 1?

LiabilityGuard Issuesโ€‹

Float Precision Errorsโ€‹

Problem: Small differences in large calculations.

Cause: Floating-point precision.

Solution: LiabilityGuard uses Decimal internally. The default tolerance is 0.01%. Adjust if needed:

guard = LiabilityGuard(tolerance_percent=0.001)  # Stricter
guard = LiabilityGuard(tolerance_percent=0.1) # More lenient

ClauseGuard Issuesโ€‹

No Conflicts Detected (False Negative)โ€‹

Problem: You expect a conflict but ClauseGuard doesn't find it.

Cause: ClauseGuard uses heuristic pattern matching, not full NLP.

Current Limitations:

  • Only detects termination-related conflicts
  • Limited to English text
  • Requires specific keyword patterns

Workaround: For complex contracts, extract key terms manually:

clauses = [
"Termination allowed after 30 days notice", # Clear pattern
"Minimum term 90 days", # Clear pattern
]

CitationGuard Issuesโ€‹

Valid Citation Marked Invalidโ€‹

Problem: A real citation is flagged as invalid.

Cause: The reporter isn't in our list.

Solution: Check if the reporter is a valid Bluebook abbreviation. If it's a less common reporter, it may not be in our list. File an issue to add it: https://github.com/QWED-AI/qwed-legal/issues

Statute Citation Formatโ€‹

Problem: 42 USC 1983 doesn't validate.

Solution: Use proper formatting with section symbol:

# โœ… Correct
guard.check_statute_citation("42 U.S.C. ยง 1983")

# โŒ Missing section symbol
guard.check_statute_citation("42 USC 1983")

General Issuesโ€‹

Import Errorsโ€‹

Problem:

ImportError: cannot import name 'LegalGuard' from 'qwed_legal'

Solution:

pip install --upgrade qwed-legal

Version Mismatch with MCPโ€‹

Problem: MCP tools don't show legal verification options.

Solution: Reinstall qwed-mcp after installing qwed-legal:

pip install qwed-legal
pip install --upgrade qwed-mcp

Still Stuck?โ€‹