{"record":{"id":"9963b8a187e24d8b","repo":"langchain-ai/langgraph","slug":"import-string-import-str-must-be-in-format-m","errorCode":null,"errorMessage":"Import string \"{import_str}\" must be in format \"<module>:<attribute>\".","messagePattern":"Import string \"(.+?)\" must be in format \"<module>:<attribute>\"\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/cli/langgraph_cli/config.py","lineNumber":887,"sourceCode":"            if \"path\" not in data:\n                raise ValueError(\n                    f\"Graph '{graph_id}' must contain a 'path' key if \"\n                    f\" it is a dictionary.\"\n                )\n            import_str = data[\"path\"]\n        elif isinstance(data, str):\n            import_str = data\n        else:\n            raise ValueError(\n                f\"Graph '{graph_id}' must be a string or a dictionary with a 'path' key.\"\n            )\n\n        module_str, _, attr_str = import_str.partition(\":\")\n        if not module_str or not attr_str:\n            message = (\n                'Import string \"{import_str}\" must be in format \"<module>:<attribute>\".'\n            )\n            raise ValueError(message.format(import_str=import_str))\n\n        # Check for either forward slash or backslash in the module string\n        # to determine if it's a file path.\n        if \"/\" in module_str or \"\\\\\" in module_str:\n            # Resolve the local path properly on the current OS\n            resolved = (config_path.parent / module_str).resolve()\n            if not resolved.exists():\n                raise FileNotFoundError(f\"Could not find local module: {resolved}\")\n            elif not resolved.is_file():\n                raise IsADirectoryError(f\"Local module must be a file: {resolved}\")\n            else:\n                for path in local_deps.real_pkgs:\n                    if resolved.is_relative_to(path):\n                        container_path = (\n                            pathlib.Path(\"/deps\")\n                            / path.name\n                            / resolved.relative_to(path)\n                        )","sourceCodeStart":869,"sourceCodeEnd":905,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/cli/langgraph_cli/config.py#L869-L905","documentation":"Raised after the graph path is extracted from config: the import string was split on ':' via partition() and either the module part or the attribute part is empty, so it is not a valid '<module>:<attribute>' reference (e.g. 'mygraph' or ':graph' instead of './graph.py:graph').","triggerScenarios":"Thrown at libs/cli/langgraph_cli/config.py:887 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the path as '<module_or_file>:<attribute>', e.g. './agent.py:graph' or 'myapp.agent:graph'.","Ensure exactly one ':' separates module and attribute."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","contentChangedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}