{"record":{"id":"1b6c1b9cb67b8851","repo":"crewAIInc/crewAI","slug":"attempted-to-install-tavily-python-but-failed","errorCode":null,"errorMessage":"Attempted to install 'tavily-python' but failed: {e}. Please install it manually to use the TavilyExtractorTool.","messagePattern":"Attempted to install 'tavily-python' but failed: (.+?)\\. Please install it manually to use the TavilyExtractorTool\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/tavily_extractor_tool/tavily_extractor_tool.py","lineNumber":116,"sourceCode":"                import subprocess\n\n                import click\n            except ImportError:\n                raise ImportError(\n                    \"The 'tavily-python' package is required. 'click' and 'subprocess' are also needed to assist with installation if the package is missing. \"\n                    \"Please install 'tavily-python' manually (e.g., 'uv add tavily-python') and ensure 'click' and 'subprocess' are available.\"\n                ) from None\n\n            if click.confirm(\n                \"You are missing the 'tavily-python' package, which is required for TavilyExtractorTool. Would you like to install it?\"\n            ):\n                try:\n                    subprocess.run([\"uv pip\", \"install\", \"tavily-python\"], check=True)  # noqa: S607\n                    raise ImportError(\n                        \"'tavily-python' has been installed. Please restart your Python application to use the TavilyExtractorTool.\"\n                    )\n                except subprocess.CalledProcessError as e:\n                    raise ImportError(\n                        f\"Attempted to install 'tavily-python' but failed: {e}. \"\n                        f\"Please install it manually to use the TavilyExtractorTool.\"\n                    ) from e\n            else:\n                raise ImportError(\n                    \"The 'tavily-python' package is required to use the TavilyExtractorTool. \"\n                    \"Please install it with: uv add tavily-python\"\n                )\n\n    def _run(\n        self,\n        urls: list[str] | str,\n    ) -> str:\n        \"\"\"Synchronously extracts content from the given URL(s).\n\n        Args:\n            urls: The URL(s) to extract data from.\n","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/tavily_extractor_tool/tavily_extractor_tool.py#L98-L134","documentation":"Raised when the interactive install of tavily-python was accepted but subprocess.run raised CalledProcessError (non-zero exit). The underlying uv/pip command output is embedded in the message via {e}. In this specific tool the command is [\"uv pip\", \"install\", \"tavily-python\"] — \"uv pip\" as one token is not a valid executable, so you usually see FileNotFoundError (uncaught) rather than this error; CalledProcessError appears when a real installer command fails (no network, read-only env, no uv).","triggerScenarios":"User answers 'y' to the install prompt and the installer subprocess exits non-zero: offline machine, uv not on PATH resolving correctly, permission-denied site-packages, or corporate proxy blocking PyPI.","commonSituations":"Air-gapped or proxied networks; containers running as non-root without write access to site-packages; CI runners without uv installed.","solutions":["Install manually with a working command: uv add tavily-python (or pip install tavily-python) in your shell, then re-create the tool.","If behind a proxy, configure PIP_INDEX_URL/UV_INDEX_URL or proxy env vars and retry the manual install.","If uv is missing, install it (curl -LsSf https://astral.sh/uv/install.sh | sh) or fall back to pip.","Report the [\"uv pip\", ...] argv bug upstream so the auto-installer command is valid."],"exampleFix":"# before (tool's internal, broken argv)\nsubprocess.run([\"uv pip\", \"install\", \"tavily-python\"], check=True)\n\n# after\nsubprocess.run([\"uv\", \"pip\", \"install\", \"tavily-python\"], check=True)","handlingStrategy":"try-catch","validationCode":"import shutil\nif shutil.which(\"uv\") is None and shutil.which(\"pip\") is None:\n    raise SystemExit(\"No installer available; pre-install tavily-python\")","typeGuard":null,"tryCatchPattern":"try:\n    tool = TavilyExtractorTool()\nexcept ImportError as e:\n    if \"Attempted to install 'tavily-python' but failed\" in str(e):\n        subprocess.run([\"pip\", \"install\", \"tavily-python\"], check=True)  # manual fallback\n        raise SystemExit(\"Installed; restart the app\") from e\n    raise","preventionTips":["Install tavily-python declaratively (uv add / pip install) instead of via the tool's auto-installer.","Verify network/index access and uv availability before running apps that may auto-install.","Remember the extractor's auto-install argv ('uv pip' as one token) is broken; never rely on it."],"tags":["tavily","installation","subprocess","network","crewai-tools"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}