{"record":{"id":"65a36bf4a8d25e0e","repo":"microsoft/qlib","slug":"can-t-find-the-base-config-file-base-config-path","errorCode":null,"errorMessage":"Can't find the BASE_CONFIG file: {base_config_path}","messagePattern":"Can't find the BASE_CONFIG file: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"qlib/cli/run.py","lineNumber":127,"sourceCode":"\n    base_config_path = config.get(\"BASE_CONFIG_PATH\", None)\n    if base_config_path:\n        logger.info(f\"Use BASE_CONFIG_PATH: {base_config_path}\")\n        base_config_path = Path(base_config_path)\n\n        # it will find config file in absolute path and relative path\n        if base_config_path.exists():\n            path = base_config_path\n        else:\n            logger.info(\n                f\"Can't find BASE_CONFIG_PATH base on: {Path.cwd()}, \"\n                f\"try using relative path to config path: {Path(config_path).absolute()}\"\n            )\n            relative_path = Path(config_path).absolute().parent.joinpath(base_config_path)\n            if relative_path.exists():\n                path = relative_path\n            else:\n                raise FileNotFoundError(f\"Can't find the BASE_CONFIG file: {base_config_path}\")\n\n        with open(path) as fp:\n            yaml = YAML(typ=\"safe\", pure=True)\n            base_config = yaml.load(fp)\n        logger.info(f\"Load BASE_CONFIG_PATH succeed: {path.resolve()}\")\n        config = update_config(base_config, config)\n\n    # config the `sys` section\n    sys_config(config, config_path)\n\n    if \"exp_manager\" in config.get(\"qlib_init\"):\n        qlib.init(**config.get(\"qlib_init\"))\n    else:\n        exp_manager = C[\"exp_manager\"]\n        exp_manager[\"kwargs\"][\"uri\"] = \"file:\" + str(Path(os.getcwd()).resolve() / uri_folder)\n        qlib.init(**config.get(\"qlib_init\"), exp_manager=exp_manager)\n\n    if \"experiment_name\" in config:","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/cli/run.py#L109-L145","documentation":"In qlib/cli/run.py, a workflow config may reference a base config via BASE_CONFIG_PATH so common settings can be shared. qlib first tries the path as given (relative to the current working directory or absolute), then relative to the directory of the main config file. If neither exists, it raises FileNotFoundError — the base YAML simply is not on disk where qlib looked.","triggerScenarios":"Running 'qrun config.yaml' (or workflow activation) where config.yaml sets BASE_CONFIG_PATH: base.yaml and base.yaml does not exist at CWD-relative or config-dir-relative location; commonly the file was renamed, deleted, or the command is run from a different directory.","commonSituations":"Cloning an examples/workflow repo that ships base_workflow_config.yaml but running qrun from another directory; CI jobs that cd elsewhere before qrun; path typos or Windows backslash separators in the YAML value.","solutions":["Place the base config next to your main config file (config-dir-relative lookup is the most robust) or use an absolute path for BASE_CONFIG_PATH.","Run qrun from the directory the relative BASE_CONFIG_PATH was written against.","Verify the file exists: 'ls <BASE_CONFIG_PATH>' from the exact directory you invoke qrun in; fix typos/case (case-sensitive on Linux)."],"exampleFix":"# before (run from ~/project, config in ~/project/examples)\nBASE_CONFIG_PATH: base.yaml  # missing at ~/project/base.yaml\n# after\nBASE_CONFIG_PATH: examples/base.yaml  # or an absolute path: /home/me/project/examples/base.yaml","handlingStrategy":"try-catch","validationCode":"from pathlib import Path\nbase = Path(cfg['qlib_init'].get('BASE_CONFIG_PATH', 'base.yaml'))\nif not base.exists():\n    base = Path(config_path).absolute().parent / base\nassert base.exists(), f'BASE_CONFIG_PATH not found: {base}'","typeGuard":null,"tryCatchPattern":"try:\n    run_workflow('config.yaml')\nexcept FileNotFoundError as e:\n    if 'BASE_CONFIG' in str(e):\n        # retry from the config's own directory where relative lookup applies\n        os.chdir(config_dir)\n        run_workflow('config.yaml')\n    else:\n        raise","preventionTips":["Keep the base config beside the main config file and invoke qrun from that directory.","Use absolute paths in CI; assert file existence in a preflight check before qrun."],"tags":["qlib","cli","config","file-not-found"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}