make matplotlib mandatory
This commit is contained in:
parent
ba883a5868
commit
23304ba20e
1 changed files with 1 additions and 9 deletions
|
|
@ -12,11 +12,7 @@ import sys
|
|||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
import matplotlib.pyplot as plt
|
||||
HAS_MATPLOTLIB = True
|
||||
except ImportError:
|
||||
HAS_MATPLOTLIB = False
|
||||
|
||||
|
||||
def load_transactions(json_files: list[Path]) -> list[dict]:
|
||||
|
|
@ -208,10 +204,6 @@ def main():
|
|||
if not path.exists():
|
||||
sys.exit(f"Error: File not found: {path}")
|
||||
|
||||
# Check matplotlib early if graph requested
|
||||
if args.graph and not HAS_MATPLOTLIB:
|
||||
sys.exit("Error: matplotlib is required for graphs. Install with: pip install matplotlib")
|
||||
|
||||
# Load categories
|
||||
if not args.categories.exists():
|
||||
sys.exit(f"Error: Categories file not found: {args.categories}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue