{"record":{"id":"17efe81e2457144b","repo":"HKUDS/nanobot","slug":"pip-is-not-available-and-uv-is-not-installed","errorCode":null,"errorMessage":"pip is not available and uv is not installed","messagePattern":"pip is not available and uv is not installed","errorType":"exception","errorClass":"CliAppError","httpStatus":null,"severity":"error","filePath":"nanobot/apps/cli/service.py","lineNumber":870,"sourceCode":"    def _pip_available() -> bool:\n        \"\"\"Return True if pip is importable for the current interpreter.\"\"\"\n        from importlib.util import find_spec\n\n        return find_spec(\"pip\") is not None\n\n    def _pip_install_argv(self, app: dict[str, Any], *, update: bool = False) -> list[str]:\n        install_cmd = str(app.get(\"install_cmd\") or \"\")\n        if not _is_pip_install_command(install_cmd) or _has_shell_meta(install_cmd):\n            raise CliAppError(\"unsupported pip install command\")\n        tokens = shlex.split(install_cmd)\n        args = tokens[2:] if tokens[:2] == [\"pip\", \"install\"] else tokens[4:]\n        pip_available = self._pip_available()\n        if pip_available:\n            prefix = [sys.executable, \"-m\", \"pip\", \"install\"]\n        elif shutil.which(\"uv\"):\n            prefix = [\"uv\", \"pip\", \"install\", \"--python\", sys.executable]\n        else:\n            raise CliAppError(\"pip is not available and uv is not installed\")\n        if update:\n            if pip_available:\n                prefix.extend([\"--upgrade\", \"--force-reinstall\"])\n            else:\n                prefix.extend([\"--upgrade\", \"--reinstall\"])\n        return prefix + args\n\n    def _pip_uninstall_argv(\n        self,\n        app: dict[str, Any],\n        installed_entry: dict[str, Any] | None = None,\n    ) -> list[str]:\n        if self._pip_available():\n            prefix = [sys.executable, \"-m\", \"pip\", \"uninstall\", \"-y\"]\n        elif shutil.which(\"uv\"):\n            prefix = [\"uv\", \"pip\", \"uninstall\", \"--python\", sys.executable]\n        else:\n            raise CliAppError(\"pip is not available and uv is not installed\")","sourceCodeStart":852,"sourceCodeEnd":888,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/apps/cli/service.py#L852-L888","documentation":"Error \"pip is not available and uv is not installed\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/apps/cli/service.py:870 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}