{"record":{"id":"21f33e19df44ec0d","repo":"Graphify-Labs/graphify","slug":"falkordb-sdk-not-installed-run-pip-install-falko","errorCode":null,"errorMessage":"falkordb SDK not installed. Run: pip install falkordb","messagePattern":"falkordb SDK not installed\\. Run: pip install falkordb","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"graphify/exporters/graphdb.py","lineNumber":111,"sourceCode":"    identical to push_to_neo4j. Differences from the Neo4j path:\n      - connects with FalkorDB(host, port, username, password) instead of a bolt\n        driver; only the host/port are read from the URI, so the scheme is\n        informational - \"falkordb://localhost:6379\", \"redis://localhost:6379\"\n        and a bare \"localhost:6379\" are all equivalent (default port 6379).\n      - a named graph is selected via db.select_graph(graph_name) (default\n        \"graphify\"); FalkorDB keys each graph by name in the same instance.\n      - queries run via graph.query(cypher, params) - there is no session object.\n      - auth is optional (FalkorDB runs without credentials by default), so user\n        and password may be None.\n      - no APOC: the Neo4j path does not use APOC either, so nothing to port.\n\n    Uses MERGE so re-running is safe - nodes and edges are upserted, not\n    duplicated. Returns a dict with counts of nodes and edges pushed.\n    \"\"\"\n    try:\n        from falkordb import FalkorDB\n    except ImportError as e:\n        raise ImportError(\n            \"falkordb SDK not installed. Run: pip install falkordb\"\n        ) from e\n\n    from urllib.parse import urlparse\n\n    node_community = _node_community_map(communities) if communities else {}\n\n    def _safe_rel(relation: str) -> str:\n        return re.sub(r\"[^A-Z0-9_]\", \"_\", relation.upper().replace(\" \", \"_\").replace(\"-\", \"_\")) or \"RELATED_TO\"\n\n    def _safe_label(label: str) -> str:\n        \"\"\"Sanitize a FalkorDB node label to prevent Cypher injection.\"\"\"\n        sanitized = re.sub(r\"[^A-Za-z0-9_]\", \"\", label)\n        return sanitized if sanitized else \"Entity\"\n\n    parsed = urlparse(uri if \"://\" in uri else f\"redis://{uri}\")\n    # FalkorDB auth is optional. Only send credentials when a password is\n    # provided; otherwise connect anonymously and ignore any bolt-style default","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/Graphify-Labs/graphify/blob/7fe58b0b0f3873be9a21c30106b8b8527c353aa6/graphify/exporters/graphdb.py#L93-L129","documentation":"Raised by graphify's FalkorDB exporter when the `falkordb` SDK cannot be imported. FalkorDB is a Redis-module-based graph database queried with Cypher over a graph key inside a Redis instance; the exporter imports the SDK lazily, mirroring the Neo4j path (MERGE upserts, optional auth) and reports the missing package with a pip hint.","triggerScenarios":"Calling the push-to-FalkorDB export function (e.g. `graphify export --falkordb ...`) where `from falkordb import FalkorDB` raises ImportError.","commonSituations":"Base graphify install without the graphdb extra; assuming the neo4j package also covers FalkorDB; running against a FalkorDB-capable Redis but forgetting the client SDK in the venv.","solutions":["pip install falkordb","Verify in the same environment: `python -c \"from falkordb import FalkorDB\"`","Then confirm the target Redis instance has the FalkorDB module loaded (connection errors are separate from this import error)"],"exampleFix":"# before\nfrom graphify.exporters.graphdb import push_to_falkordb\npush_to_falkordb(G, host=\"localhost\", port=6379)  # ImportError\n\n# after\npip install falkordb\npush_to_falkordb(G, host=\"localhost\", port=6379)","handlingStrategy":"validation","validationCode":"import importlib.util\n\nif importlib.util.find_spec(\"falkordb\") is None:\n    raise SystemExit(\"Install the FalkorDB SDK first: pip install falkordb\")\n\nfrom graphify.exporters.graphdb import push_to_falkordb\npush_to_falkordb(G, host=\"localhost\", port=6379)","typeGuard":null,"tryCatchPattern":"try:\n    push_to_falkordb(G, host=host, port=port)\nexcept ImportError as e:\n    if \"falkordb\" in str(e):\n        log.warning(\"falkordb export skipped: %s\", e)\n    else:\n        raise","preventionTips":["The neo4j package does not cover FalkorDB - install the falkordb SDK separately","Preflight the SDK import before pointing jobs at a FalkorDB-backed Redis","Keep exporter deps in an extras group so one pip line installs both drivers"],"tags":["dependency","falkordb","redis","graph-database","import-error"],"backgroundTag":null,"analyzedSha":"7fe58b0b0f3873be9a21c30106b8b8527c353aa6","analyzedAt":"2026-08-14T19:23:21.323Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}