{"record":{"id":"5c174dc86246f2d8","repo":"crewAIInc/crewAI","slug":"the-linkup-sdk-package-is-required-to-use-the-li","errorCode":null,"errorMessage":"The 'linkup-sdk' package is required to use the LinkupSearchTool. Please install it with: uv add linkup-sdk","messagePattern":"The 'linkup-sdk' package is required to use the LinkupSearchTool\\. Please install it with: uv add linkup-sdk","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/linkup/linkup_search_tool.py","lineNumber":50,"sourceCode":"\n    def __init__(self, api_key: str | None = None) -> None:\n        \"\"\"Initialize the tool with an API key.\"\"\"\n        super().__init__()  # type: ignore[call-arg]\n        try:\n            from linkup import LinkupClient\n        except ImportError:\n            import click\n\n            if click.confirm(\n                \"You are missing the 'linkup-sdk' package. Would you like to install it?\"\n            ):\n                import subprocess\n\n                subprocess.run([\"uv\", \"add\", \"linkup-sdk\"], check=True)  # noqa: S607\n                from linkup import LinkupClient\n\n            else:\n                raise ImportError(\n                    \"The 'linkup-sdk' package is required to use the LinkupSearchTool. \"\n                    \"Please install it with: uv add linkup-sdk\"\n                ) from None\n        self._client = LinkupClient(api_key=api_key or os.getenv(\"LINKUP_API_KEY\"))\n\n    def _run(\n        self,\n        query: str,\n        depth: Literal[\"standard\", \"deep\"] = \"standard\",\n        output_type: Literal[\n            \"searchResults\", \"sourcedAnswer\", \"structured\"\n        ] = \"searchResults\",\n    ) -> dict[str, Any]:\n        \"\"\"Executes a search using the Linkup API.\n\n        :param query: The query to search for.\n        :param depth: Search depth (default is \"standard\").\n        :param output_type: Desired result type (default is \"searchResults\").","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/linkup/linkup_search_tool.py#L32-L68","documentation":"LinkupSearchTool tries to import LinkupClient; on ImportError it interactively offers to install linkup-sdk via `uv add`. If stdin is not a TTY (or the user declines the click.confirm prompt), it raises this ImportError telling you to install the SDK manually. The interactive prompt makes it especially fragile in CI and non-interactive agent runs.","triggerScenarios":"Instantiating LinkupSearchTool() without linkup-sdk installed; running in CI/containers where click.confirm gets EOF and returns False; answering 'no' to the install prompt.","commonSituations":"Deploying to Docker/CI where no TTY exists so the confirm prompt auto-fails; environments without `uv` on PATH so even accepting the prompt would crash; fresh clones that only ran `pip install crewai-tools`.","solutions":["Install the SDK in the runtime environment: `uv add linkup-sdk` or `pip install linkup-sdk`","Add linkup-sdk to your requirements/pyproject so CI never reaches the interactive prompt","Set LINKUP_API_KEY as well so the client initializes correctly after install"],"exampleFix":"# before\ntool = LinkupSearchTool()  # ImportError: requires linkup-sdk\n\n# after\n# uv add linkup-sdk  (or pip install linkup-sdk)\nimport os\nos.environ[\"LINKUP_API_KEY\"] = \"...\"\ntool = LinkupSearchTool()","handlingStrategy":"validation","validationCode":"def linkup_ready() -> bool:\n    try:\n        import linkup  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nassert linkup_ready(), \"uv add linkup-sdk (run before starting the crew)\"","typeGuard":null,"tryCatchPattern":"try:\n    from crewai_tools.tools.linkup.linkup_search_tool import LinkupSearchTool\n    tool = LinkupSearchTool()\nexcept ImportError as e:\n    raise RuntimeError(\"Install linkup-sdk before using LinkupSearchTool\") from e","preventionTips":["Never rely on click.confirm install prompts in CI — pre-install optional SDKs","Keep a per-tool dependency manifest and install all of it at image build time","Set LINKUP_API_KEY via the environment, not code"],"tags":["dependency","linkup","interactive-prompt","ci","crewai-tools"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}