mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-01 17:47:19 +00:00
78 lines
2.3 KiB
Plaintext
78 lines
2.3 KiB
Plaintext
---
|
||
title: "Installation"
|
||
id: installation
|
||
slug: "/installation"
|
||
description: "See how to quickly install Haystack with pip or conda."
|
||
---
|
||
|
||
# Installation
|
||
|
||
See how to quickly install Haystack with pip or conda.
|
||
|
||
## Package Installation
|
||
|
||
Use [pip](https://github.com/pypa/pip) to install only the Haystack code:
|
||
|
||
```shell
|
||
pip install haystack-ai
|
||
```
|
||
|
||
Alternatively, you can use [conda](https://docs.conda.io/projects/conda/en/stable/):
|
||
|
||
```shell
|
||
conda config --add channels conda-forge/label/haystack-ai_rc
|
||
conda install haystack-ai
|
||
```
|
||
|
||
<br />
|
||
|
||
<details>
|
||
|
||
<summary>Were you already using Haystack 1.x?</summary>
|
||
|
||
:::warning
|
||
|
||
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:
|
||
|
||
```bash
|
||
pip uninstall -y farm-haystack haystack-ai
|
||
pip install haystack-ai
|
||
```
|
||
|
||
If you have any questions, please reach out to us on the [GitHub Discussion](https://github.com/deepset-ai/haystack/discussions) or [Discord](https://discord.com/invite/VBpFzsgRVF).
|
||
:::
|
||
|
||
</details>
|
||
|
||
### 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:
|
||
|
||
```shell
|
||
ImportError: "Haystack failed to import the optional dependency 'pypdf'. Run 'pip install pypdf'.
|
||
```
|
||
|
||
## Contributing to Haystack
|
||
|
||
If you would like to contribute to the Haystack, check our [Contributor Guidelines](https://github.com/deepset-ai/haystack/blob/main/CONTRIBUTING.md) first.
|
||
|
||
To be able to make changes to Haystack code, install with the following commands:
|
||
|
||
```shell
|
||
## 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]'
|
||
```
|