Environment:Deepset ai Haystack Python Runtime Environment
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, NLP |
| Last Updated | 2026-02-11 20:00 GMT |
Overview
Python 3.10+ runtime environment with core dependencies for building and running Haystack LLM pipelines.
Description
This environment defines the base Python runtime and core package dependencies required to run any Haystack pipeline. It provides the foundation for the framework including pipeline graph orchestration via NetworkX, template rendering via Jinja2, OpenAI API integration, serialization, and structured logging. All Haystack components inherit this base environment. The framework is OS-independent and supports Linux, macOS, and Windows.
Usage
Use this environment for any Haystack pipeline or component execution. This is the mandatory base prerequisite for all Implementations in the Haystack framework, from document indexing to RAG pipelines to evaluation workflows.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | OS Independent | Linux, macOS, Windows all supported |
| Python | >= 3.10 | Officially tested: 3.10, 3.11, 3.12, 3.13 |
| Disk | Minimal | Core package is lightweight; models require additional space |
Dependencies
System Packages
- No special system packages required for base functionality
Python Packages
- `haystack-ai` (the framework itself)
- `openai` >= 1.99.2
- `typing_extensions` >= 4.7
- `networkx` (pipeline DAG orchestration)
- `Jinja2` (prompt template rendering)
- `pydantic` (data validation)
- `pyyaml` (serialization)
- `numpy` (numerical operations)
- `tqdm` (progress bars)
- `tenacity` != 8.4.0 (retry logic; 8.4.0 excluded due to bugs)
- `lazy-imports` (optional dependency management)
- `posthog` != 3.12.0 (telemetry; 3.12.0 excluded due to bugs)
- `more-itertools` (used by TextDocumentSplitter)
- `requests` (HTTP client)
- `python-dateutil` (date parsing)
- `jsonschema` (JSON schema validation for Tools)
- `docstring-parser` (ComponentTool introspection)
- `filetype` (MIME type detection)
- `haystack-experimental` (experimental features)
Credentials
No credentials are required for the base runtime. Individual components (OpenAI generators, HuggingFace embedders) require their own API tokens. See:
- Environment:Deepset_ai_Haystack_OpenAI_API_Environment for OpenAI API keys
- Environment:Deepset_ai_Haystack_HuggingFace_Model_Environment for HuggingFace tokens
Quick Install
pip install haystack-ai
Code Evidence
Python version requirement from `pyproject.toml:11`:
requires-python = ">=3.10"
Core dependencies from `pyproject.toml:43-62`:
dependencies = [
"tqdm",
"tenacity!=8.4.0",
"lazy-imports",
"openai>=1.99.2",
"pydantic",
"Jinja2",
"posthog!=3.12.0",
"pyyaml",
"more-itertools",
"networkx",
"typing_extensions>=4.7",
"requests",
"numpy",
"python-dateutil",
"jsonschema",
"docstring-parser",
"filetype",
"haystack-experimental",
]
Version detection from `haystack/version.py:5-10`:
from importlib import metadata
try:
__version__ = str(metadata.version("haystack-ai"))
except metadata.PackageNotFoundError:
__version__ = "main"
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `ModuleNotFoundError: No module named 'haystack'` | Package not installed | `pip install haystack-ai` (not `pip install haystack`) |
| `ImportError: tenacity` | Incompatible tenacity version 8.4.0 | `pip install "tenacity!=8.4.0"` |
| `ImportError: posthog` | Incompatible posthog version 3.12.0 | `pip install "posthog!=3.12.0"` |
Compatibility Notes
- Package name: Install `haystack-ai`, not `haystack` (the old Haystack 1.x package)
- Python 3.9 and below: Not supported; requires 3.10+ for typing features
- tenacity 8.4.0: Explicitly excluded due to known issues
- posthog 3.12.0: Explicitly excluded due to known issues (https://github.com/PostHog/posthog-python/issues/187)
Related Pages
- Implementation:Deepset_ai_Haystack_Pipeline_Run
- Implementation:Deepset_ai_Haystack_Pipeline_Run_For_Evaluation
- Implementation:Deepset_ai_Haystack_InMemoryDocumentStore
- Implementation:Deepset_ai_Haystack_DocumentWriter
- Implementation:Deepset_ai_Haystack_PromptBuilder
- Implementation:Deepset_ai_Haystack_ChatPromptBuilder
- Implementation:Deepset_ai_Haystack_AnswerBuilder
- Implementation:Deepset_ai_Haystack_FileTypeRouter
- Implementation:Deepset_ai_Haystack_TextFileToDocument
- Implementation:Deepset_ai_Haystack_DocumentJoiner
- Implementation:Deepset_ai_Haystack_DocumentCleaner
- Implementation:Deepset_ai_Haystack_DocumentSplitter
- Implementation:Deepset_ai_Haystack_MetadataRouter
- Implementation:Deepset_ai_Haystack_DocumentLanguageClassifier
- Implementation:Deepset_ai_Haystack_Document_Dataclass
- Implementation:Deepset_ai_Haystack_ExtractedAnswer_Dataclass