ScrapeGraphAI/Scrapegraph-ai · error · AttributeError
module has no attribute
Error message
module {__name__!r} has no attribute {name!r} What it means
RAGNode lazily imports qdrant_client at execution time and re-raises ImportError with this message when the package is absent. Qdrant is an optional dependency used to store and search document embeddings, so it is not installed with the core library.
Solutions
- Install the client: pip install qdrant-client (or uv add qdrant-client).
- Add qdrant-client to your project's dependency list so environments are reproducible.
- If you never need RAG, remove RAGNode from the graph instead of installing the package.
Example fix
# before: RAGSearchGraph run fails with ImportError # after (shell) # pip install qdrant-client
Defensive patterns
Strategy: validation
Validate before calling
try:
import qdrant_client # noqa: F401
except ImportError:
raise SystemExit("Install optional dependency: pip install qdrant-client") Type guard
null
Try / catch
try:
result = rag_graph.run()
except ImportError as e:
if "qdrant_client" in str(e):
subprocess.check_call([sys.executable, "-m", "pip", "install", "qdrant-client"]) # or surface a clear message Prevention
- Declare qdrant-client in your requirements when using RAG graphs.
- In Docker/CI, install optional extras needed by the graphs you actually run.
When it happens
Trigger: Building any graph that includes RAGNode (e.g. RAGSearchGraph) in an environment where qdrant-client is not installed; a fresh venv or Docker image that only installed scrapegraphai's base extras.
Common situations: CI pipelines or slim Docker images missing optional dependencies; adding RAG features to an existing project without updating requirements; dependency pruning tools removing 'unused' optional packages.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
- The browserbase module is not installed. Please install it…
- burr package is not installed. Please install…
- Could not import the 'ddgs' package required for DuckDuckGo…
- scrapegraph_py is not installed. Install it with 'pip…
- The dependencies for screenshot scraping are not installed…
AI-assisted analysis of ScrapeGraphAI/Scrapegraph-ai@532dfffbf6 (2026-08-28).
Data as JSON: /api/errors/18616f657e288da1.
Report an issue: GitHub.
Appendix: source
Thrown at scrapegraphai/docloaders/__init__.py:22
Note: ChromiumLoader and PlasmateLoader are lazy-imported to avoid triggering
torchcodec/FFmpeg DLL loading at import time (sentence_transformers -> torchcodec chain).
"""
from .browser_base import browser_base_fetch
from .scrape_do import scrape_do_fetch
_LAZY_MODULES = {
"ChromiumLoader": ".chromium",
"PlasmateLoader": ".plasmate",
}
def __getattr__(name):
if name in _LAZY_MODULES:
import importlib
module = importlib.import_module(_LAZY_MODULES[name], __package__)
return getattr(module, name)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
__all__ = [
"browser_base_fetch",
"ChromiumLoader",
"PlasmateLoader",
"scrape_do_fetch",
]
View on GitHub (pinned to 532dfffbf6)