{"record":{"id":"85bbaabbfc5a5294","repo":"ScrapeGraphAI/Scrapegraph-ai","slug":"pandas-is-not-installed-please-install-it-using","errorCode":null,"errorMessage":"pandas is not installed. Please install it using `pip install pandas`.","messagePattern":"pandas is not installed\\. Please install it using `pip install pandas`\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"scrapegraphai/nodes/fetch_node.py","lineNumber":203,"sourceCode":"            loader = PyPDFLoader(source)\n            # PyPDFLoader.load() can be blocking for large PDFs. Run it in a thread and\n            # enforce the configured timeout if provided.\n            if self.timeout is None:\n                return loader.load()\n            else:\n                with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:\n                    future = executor.submit(loader.load)\n                    try:\n                        return future.result(timeout=self.timeout)\n                    except concurrent.futures.TimeoutError:\n                        raise TimeoutError(\n                            f\"PDF parsing exceeded timeout of {self.timeout} seconds\"\n                        )\n        elif input_type == \"csv\":\n            try:\n                import pandas as pd\n            except ImportError:\n                raise ImportError(\n                    \"pandas is not installed. Please install it using `pip install pandas`.\"\n                )\n            return [\n                Document(\n                    page_content=str(pd.read_csv(source)), metadata={\"source\": \"csv\"}\n                )\n            ]\n        elif input_type == \"json\":\n            with open(source, encoding=\"utf-8\") as f:\n                return [\n                    Document(\n                        page_content=str(json.load(f)), metadata={\"source\": \"json\"}\n                    )\n                ]\n        elif input_type == \"xml\" or input_type == \"md\":\n            with open(source, \"r\", encoding=\"utf-8\") as f:\n                data = f.read()\n            return [Document(page_content=data, metadata={\"source\": input_type})]","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/ScrapeGraphAI/Scrapegraph-ai/blob/532dfffbf6ee823a6c9cf8cfedc24a93bf026780/scrapegraphai/nodes/fetch_node.py#L185-L221","documentation":"When the fetch input is a CSV file, load_file_content imports pandas; if pandas is not installed in the environment the ImportError is re-raised with install instructions. ScrapeGraphAI does not ship pandas as a hard dependency, so CSV support is opt-in.","triggerScenarios":"Feeding a .csv source path to a graph (e.g. SmartScraperGraph with source='data.csv') in an environment where pandas is missing — minimal install, slim Docker image, or a venv without extras.","commonSituations":"Docker/CI images that only install core deps; using csv input for the first time; pandas removed during dependency cleanup.","solutions":["Install pandas: pip install pandas (or uv add pandas / uv sync --extra with the appropriate extra)","For Dockerfiles, add pandas to the image","Alternatively convert the CSV to another supported format (JSON/text) before fetching"],"exampleFix":"# before: raises ImportError on csv source\n$ pip install pandas  # shell fix\n# after\ngraph_config = {'source': 'data.csv', ...}  # now works","handlingStrategy":"validation","validationCode":"try:\n    import pandas  # noqa\n    PANDAS_OK = True\nexcept ImportError:\n    PANDAS_OK = False\n\nif source.endswith('.csv') and not PANDAS_OK:\n    raise SystemExit('pip install pandas before using CSV sources')","typeGuard":"def csv_supported() -> bool:\n    try:\n        import pandas  # noqa\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    graph.run()\nexcept ImportError as e:\n    if 'pandas' in str(e):\n        subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'pandas'])\n    else:\n        raise","preventionTips":["Include pandas in Dockerfiles when CSV inputs are possible","Feature-detect optional deps at startup, not mid-run"],"tags":["scrapegraphai","fetch-node","csv","pandas","missing-dependency"],"backgroundTag":"missing-optional-dependency","analyzedSha":"532dfffbf6ee823a6c9cf8cfedc24a93bf026780","analyzedAt":"2026-08-28T15:19:38.821Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}