Installation
See how to quickly install Haystack with pip or conda.
Package Installation
Use pip to install only the Haystack code:
Alternatively, you can use conda:
Were you already using Haystack 1.x?
Installing farm-haystack and haystack-ai in the same Python environment (virtualenv, Colab, or system) causes problems.
Installing both packages in the same environment can somehow work or fail in obscure ways. We suggest installing only one of these packages per Python environment. Make sure that you remove both packages if they are installed in the same environment, followed by installing only one of them:
If you have any questions, please reach out to us on the GitHub Discussion or Discord.
Optional Dependencies
Some components in Haystack rely on additional optional dependencies. To keep the installation lightweight, these are not included by default – only the essentials are installed. If you use a feature that requires an optional dependency that hasn't been installed, Haystack will raise an error that instructs you to install missing dependencies, for example:
Contributing to Haystack
If you would like to contribute to the Haystack, check our Contributor Guidelines first.
To be able to make changes to Haystack code, install with the following commands:
## Clone the repo
git clone https://github.com/deepset-ai/haystack.git
## Move into the cloned folder
cd haystack
## Upgrade pip
pip install --upgrade pip
## Install Haystack in editable mode
pip install -e '.[dev]'