{"record":{"id":"a0b47bfb06d90f4c","repo":"crewAIInc/crewAI","slug":"oxylabs-package-not-found-please-run-uv-add-ox-a0b47b","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_amazon_search_scraper_tool/oxylabs_amazon_search_scraper_tool.py","lineNumber":139,"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 = OxylabsAmazonSearchScraperConfig()\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) -> str:","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/oxylabs_amazon_search_scraper_tool/oxylabs_amazon_search_scraper_tool.py#L121-L157","documentation":"Raised by OxylabsAmazonSearchScraperTool.__init__ when the oxylabs package is not importable and the user declines (or cannot answer) the click.confirm install prompt. The message tells you to install it with `uv add oxylabs`.","triggerScenarios":"OxylabsAmazonSearchScraperTool(...) without oxylabs installed; prompt answered 'no' or stdin is closed (EOF) in a non-interactive process.","commonSituations":"Headless CI/cron runs where click.confirm aborts; intentional refusal to let a library mutate dependencies at runtime.","solutions":["pip install oxylabs (or uv add oxylabs in a uv project) before constructing the tool.","Pin oxylabs in your dependency manifest so environments are reproducible.","Quick check: python -c \"import oxylabs\"."],"exampleFix":"# before\ntool = OxylabsAmazonSearchScraperTool()  # ImportError\n\n# after\n# pip install oxylabs\ntool = OxylabsAmazonSearchScraperTool(username=u, password=p)","handlingStrategy":"validation","validationCode":"try:\n    import oxylabs  # noqa: F401\nexcept ImportError:\n    raise SystemExit(\"Dependency missing: pip install oxylabs\")","typeGuard":null,"tryCatchPattern":"try:\n    tool = OxylabsAmazonSearchScraperTool(username=u, password=p)\nexcept ImportError as e:\n    raise SystemExit(\"pip install oxylabs, then retry\") from e","preventionTips":["Declare oxylabs in the project manifest.","Skip interactive prompts in CI by ensuring the package is preinstalled."],"tags":["oxylabs","dependency","import-error","scraping"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}