langchain-ai/langgraph · error · ValueError
Import string "{import_str}" must be in format "<module>:<at
Error message
Import string "{import_str}" must be in format "<module>:<attribute>". What it means
Error "Import string "{import_str}" must be in format "<module>:<attribute>"." thrown in langchain-ai/langgraph.
Source
Thrown at libs/cli/langgraph_cli/config.py:887
if "path" not in data:
raise ValueError(
f"Graph '{graph_id}' must contain a 'path' key if "
f" it is a dictionary."
)
import_str = data["path"]
elif isinstance(data, str):
import_str = data
else:
raise ValueError(
f"Graph '{graph_id}' must be a string or a dictionary with a 'path' key."
)
module_str, _, attr_str = import_str.partition(":")
if not module_str or not attr_str:
message = (
'Import string "{import_str}" must be in format "<module>:<attribute>".'
)
raise ValueError(message.format(import_str=import_str))
# Check for either forward slash or backslash in the module string
# to determine if it's a file path.
if "/" in module_str or "\\" in module_str:
# Resolve the local path properly on the current OS
resolved = (config_path.parent / module_str).resolve()
if not resolved.exists():
raise FileNotFoundError(f"Could not find local module: {resolved}")
elif not resolved.is_file():
raise IsADirectoryError(f"Local module must be a file: {resolved}")
else:
for path in local_deps.real_pkgs:
if resolved.is_relative_to(path):
container_path = (
pathlib.Path("/deps")
/ path.name
/ resolved.relative_to(path)
)View on GitHub (pinned to 38031739e5)
When it happens
Trigger: Thrown at libs/cli/langgraph_cli/config.py:887 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/9963b8a187e24d8b.
Report an issue: GitHub.