{"record":{"id":"5a0470b49c4341cc","repo":"huggingface/transformers","slug":"you-picked-the-self-name-backend-but-it-is-not","errorCode":null,"errorMessage":"You picked the {self.name} backend, but it is not installed. Run {self.pip_install()}.","messagePattern":"You picked the (.+?) backend, but it is not installed\\. Run (.+?)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/transformers/hyperparameter_search.py","lineNumber":51,"sourceCode":"\n\nclass HyperParamSearchBackendBase:\n    name: str\n    pip_package: str | None = None\n\n    @staticmethod\n    def is_available():\n        raise NotImplementedError\n\n    def run(self, trainer, n_trials: int, direction: str, **kwargs):\n        raise NotImplementedError\n\n    def default_hp_space(self, trial):\n        raise NotImplementedError\n\n    def ensure_available(self):\n        if not self.is_available():\n            raise RuntimeError(\n                f\"You picked the {self.name} backend, but it is not installed. Run {self.pip_install()}.\"\n            )\n\n    @classmethod\n    def pip_install(cls):\n        return f\"`pip install {cls.pip_package or cls.name}`\"\n\n\nclass OptunaBackend(HyperParamSearchBackendBase):\n    name = \"optuna\"\n\n    @staticmethod\n    def is_available():\n        return is_optuna_available()\n\n    def run(self, trainer, n_trials: int, direction: str, **kwargs):\n        return run_hp_search_optuna(trainer, n_trials, direction, **kwargs)\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/huggingface/transformers/blob/a597f974857b3d92939971296bc0deb93d33d780/src/transformers/hyperparameter_search.py#L33-L69","documentation":"Error \"You picked the {self.name} backend, but it is not installed. Run {self.pip_install()}.\" thrown in huggingface/transformers.","triggerScenarios":"Raised in hyperparameter_search when the chosen backend (optuna, ray, sigopt, wandb) is not installed.","commonSituations":"Calling Trainer.hyperparameter_search with a backend whose extra package is missing from the environment.","solutions":["Install the selected backend with the suggested pip command.","Choose a different hyperparameter search backend that is installed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a597f974857b3d92939971296bc0deb93d33d780","analyzedAt":"2026-08-14T18:24:08.354Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}