{"record":{"id":"a1e46429333c6186","repo":"crewAIInc/crewAI","slug":"oxylabs-package-not-found-please-run-uv-add-ox-a1e464","errorCode":null,"errorMessage":"`oxylabs` package not found, please run `uv add oxylabs`","messagePattern":"`oxylabs` package not found, please run `uv add oxylabs`","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/oxylabs_google_search_scraper_tool/oxylabs_google_search_scraper_tool.py","lineNumber":142,"sourceCode":"\n            if click.confirm(\n                \"You are missing the 'oxylabs' package. Would you like to install it?\"\n            ):\n                import subprocess\n\n                try:\n                    subprocess.run([\"uv\", \"add\", \"oxylabs\"], check=True)  # noqa: S607\n                    from oxylabs import RealtimeClient\n\n                    kwargs[\"oxylabs_api\"] = RealtimeClient(\n                        username=username,\n                        password=password,\n                        sdk_type=sdk_type,\n                    )\n                except subprocess.CalledProcessError as e:\n                    raise ImportError(\"Failed to install oxylabs package\") from e\n            else:\n                raise ImportError(\n                    \"`oxylabs` package not found, please run `uv add oxylabs`\"\n                )\n\n        if config is None:\n            config = OxylabsGoogleSearchScraperConfig()\n        super().__init__(config=config, **kwargs)\n\n    def _get_credentials_from_env(self) -> tuple[str, str]:\n        username = os.environ.get(\"OXYLABS_USERNAME\")\n        password = os.environ.get(\"OXYLABS_PASSWORD\")\n        if not username or not password:\n            raise ValueError(\n                \"You must pass oxylabs username and password when instantiating the tool \"\n                \"or specify OXYLABS_USERNAME and OXYLABS_PASSWORD environment variables\"\n            )\n        return username, password\n\n    def _run(self, query: str, **kwargs: Any) -> str:","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/oxylabs_google_search_scraper_tool/oxylabs_google_search_scraper_tool.py#L124-L160","documentation":"Raised by OxylabsGoogleSearchScraperTool.__init__ when the oxylabs SDK is absent and the interactive install prompt is declined (or stdin is closed), so the tool refuses to construct and directs you to `uv add oxylabs`.","triggerScenarios":"OxylabsGoogleSearchScraperTool(...) with oxylabs not installed and click.confirm returning False — declined manually or because the process has no interactive stdin (CI, Docker, cron).","commonSituations":"Automated environments where the prompt is effectively declined; developers who do not want runtime dependency mutation.","solutions":["pip install oxylabs (or uv add oxylabs in a uv project) before instantiation.","Add oxylabs to your requirements/pyproject so environments are built complete.","Verify importability first: python -c \"import oxylabs\"."],"exampleFix":"# before\ntool = OxylabsGoogleSearchScraperTool()  # ImportError\n\n# after\n# pip install oxylabs\ntool = OxylabsGoogleSearchScraperTool(username=u, password=p)","handlingStrategy":"validation","validationCode":"try:\n    import oxylabs  # noqa: F401\nexcept ImportError:\n    raise SystemExit(\"Run `pip install oxylabs` (or `uv add oxylabs`) before constructing the tool\")","typeGuard":null,"tryCatchPattern":"try:\n    tool = OxylabsGoogleSearchScraperTool(username=u, password=p)\nexcept ImportError as e:\n    raise SystemExit(\"Install oxylabs, then retry\") from e","preventionTips":["Preinstall oxylabs in CI images so prompts never appear.","Pin the dependency version in your manifest."],"tags":["oxylabs","dependency","import-error","scraping"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}