🎉 We are working to make this website better, stay tuned. In the meantime, have a look at our up to date Installation section in the new docs.
You can install a basic version of Haystack's latest release by using pip.
pip install farm-haystack
This command will install everything needed for basic Pipelines that use an Elasticsearch Document Store.
If you plan to be using more advanced features like Milvus, FAISS, Weaviate, OCR or Ray, you will need to install a full version of Haystack. The following command will install the latest version of Haystack from the main branch.
git clone https://github.com/deepset-ai/haystack.gitcd haystackpip install --upgrade pippip install -e '.[all]' ## or 'all-gpu' for the GPU-enabled dependencies
-e flag makes this an editable installation meaning that changes to the cloned repo will affect how the package runs.
You can call
git pull on the repo to update.
install command does not work for you and you have
pip<21.3, see Custom Installation
Installing the REST API and UI
Haystack comes packaged with a REST API so that it can be deployed as a service. There is also a UI that interacts with this service to provide an interactive app to the user. To install these, run the following from the root directory of the Haystack repo.
pip install rest_api/pip install ui/
Other Operating Systems
pip install farm-haystack -f https://download.pytorch.org/whl/torch_stable.html
Apple Silicon (M1)
Macs with a M1 processor require some extra dependencies in order to install Haystack.
# some additional dependencies needed on m1 macbrew install postgresqlbrew install cmakebrew install rust# haystack installationGRPC_PYTHON_BUILD_SYSTEM_ZLIB=true pip install farm-haystack
To install groups of optional dependencies along with Haystack, specify them in the
pip install command.
The dependencies of Haystack are split into different groupings which you can find in
# install haystack and all optional depedenciespip install -e .[all]# install haystack and all optional dependencies with gpu supportpip install -e .[all-gpu]# install haystack and all docstores with gpu supportpip install -e .[docstores-gpu]# install haystack and faiss with gpu supportpip install -e .[faiss-gpu]
If you are running
pip<21.3 you won't be able to install dependency groups that reference other groups.
Instead you can only specify groups that contain direct package references.
# instead of [all]pip install -e .[sql,only-faiss,only-milvus1,weaviate,graphdb,crawler,preprocessing,ocr,onnx,ray,dev]# instead of [all-gpu]pip install -e .[sql,only-faiss-gpu,only-milvus1,weaviate,graphdb,crawler,preprocessing,ocr,onnx-gpu,ray,dev]