Langchain-Chatchat/docs/INSTALL.md

64 lines
1.8 KiB
Markdown
Raw Normal View History

2023-04-16 02:21:26 +08:00
# 安装
## 环境检查
```shell
2023-08-09 22:04:28 +08:00
# 首先,确信你的机器安装了 Python 3.8 - 3.10 版本
2023-04-16 02:21:26 +08:00
$ python --version
Python 3.8.13
# 如果低于这个版本可使用conda安装环境
$ conda create -p /your_path/env_name python=3.8
# 激活环境
$ source activate /your_path/env_name
2023-07-27 23:22:07 +08:00
# 或conda安装不指定路径, 注意以下,都将/your_path/env_name替换为env_name
$ conda create -n env_name python=3.8
$ conda activate env_name # Activate the environment
# 更新py库
2023-05-19 11:04:28 +08:00
$ pip3 install --upgrade pip
2023-04-16 02:21:26 +08:00
# 关闭环境
$ source deactivate /your_path/env_name
# 删除环境
$ conda env remove -p /your_path/env_name
```
## 项目依赖
```shell
# 拉取仓库
$ git clone https://github.com/chatchat-space/Langchain-Chatchat.git
2023-04-16 02:21:26 +08:00
2023-05-04 13:34:01 +08:00
# 进入目录
$ cd Langchain-Chatchat
2023-05-04 13:34:01 +08:00
2023-08-12 11:21:29 +08:00
# 安装全部依赖
2023-04-16 02:21:26 +08:00
$ pip install -r requirements.txt
2023-08-12 11:21:29 +08:00
# 默认依赖包括基本运行环境FAISS向量库。如果要使用 milvus/pg_vector 等向量库,请将 requirements.txt 中相应依赖取消注释再安装。
2023-04-16 02:21:26 +08:00
```
2023-07-11 19:36:50 +08:00
2023-08-12 11:21:29 +08:00
此外,为方便用户 API 与 webui 分离运行,可单独根据运行需求安装依赖包。
2023-08-11 23:30:07 +08:00
2023-08-12 11:21:29 +08:00
- 如果只需运行 API可执行
2023-08-11 23:30:07 +08:00
```shell
2023-08-12 11:21:29 +08:00
$ pip install -r requirements_api.txt
# 默认依赖包括基本运行环境FAISS向量库。如果要使用 milvus/pg_vector 等向量库,请将 requirements.txt 中相应依赖取消注释再安装。
```
2023-08-11 23:30:07 +08:00
2023-08-12 11:21:29 +08:00
- 如果只需运行 WebUI可执行
2023-08-11 23:30:07 +08:00
```shell
2023-08-12 11:21:29 +08:00
$ pip install -r requirements_webui.txt
```
注:使用 `langchain.document_loaders.UnstructuredFileLoader` 进行 `.docx` 等格式非结构化文件接入时,可能需要依据文档进行其他依赖包的安装,请参考 [langchain 文档](https://python.langchain.com/en/latest/modules/indexes/document_loaders/examples/unstructured_file.html)。