安装 Langflow
Langflow 可以通过多种方式安装:
-
Langflow Desktop (推荐): 下载并安装独立的桌面应用程序,获得最简单的设置体验。 此选项包含依赖管理并简化了升级过程。
-
Docker: 拉取并运行 Langflow Docker 镜像以启动 Langflow 容器,并在隔离环境中运行 Langflow。
-
Python 包: 安装并运行 Langflow OSS Python 包。 此选项可让您更好地控制环境、依赖和版本。
-
从源代码安装: 如果您想为 Langflow 代码库或文档做贡献,请使用此选项。
安装并运行 Langflow Desktop
Langflow Desktop 是 Langflow 的桌面版本,简化了依赖管理和升级。 但是,某些功能在 Langflow Desktop 中不可用,例如 Shareable Playground。
- macOS
- Windows
Langflow Desktop 需要 macOS 13 或更高版本。
- 导航到 Langflow Desktop。
- 点击 Download Langflow,输入您的联系信息,然后点击 Download。
- 挂载并安装 Langflow 应用程序。
- 安装完成后,打开 Langflow 应用程序,然后使用 Quickstart 创建您的第一个流程。
-
导航到 Langflow Desktop。
-
点击 Download Langflow,输入您的联系信息,然后点击 Download。
-
打开 File Explorer,然后导航到 Downloads。
-
双击下载的
.msi
文件,然后使用安装向导安装 Langflow Desktop。importantLangflow Desktop 的 Windows 安装需要 C++ 编译器,而您的系统上可能没有安装。如果您收到
C++ Build Tools Required!
错误,请按照屏幕提示安装 Microsoft C++ Build Tools,或 安装 Microsoft Visual Studio。 -
安装完成后,打开 Langflow 应用程序,然后使用 Quickstart 创建您的第一个流程。
有关升级信息,请参阅 Release notes。
要在 Langflow Desktop 中管理依赖,请参阅 在 Langflow Desktop 中安装自定义依赖。
使用 Docker 安装并运行 Langflow
您可以使用 Langflow Docker 镜像来启动 Langflow 容器。 有关更多信息,请参阅 在 Docker 上部署 Langflow。
-
安装并启动 Docker。
-
拉取最新的 Langflow Docker 镜像 并启动它:
_10docker run -p 7860:7860 langflowai/langflow:latest -
要访问 Langflow,请导航到
http://localhost:7860/
。 -
使用 Quickstart 创建您的第一个流程。
安装并运行 Langflow OSS Python 包
-
确保您拥有所需的依赖项和基础设施:
-
使用 uv 创建虚拟环境。
Need help with virtual environments?
Virtual environments ensure Langflow is installed in an isolated, fresh environment. To create a new virtual environment, do the following.
- Linux or macOS
- Windows
-
Navigate to where you want your virtual environment to be created, and then create it with
uv
:_10uv venv VENV_NAMEReplace
VENV_NAME
with a name for your virtual environment. -
Start the virtual environment:
_10source VENV_NAME/bin/activateYour shell's prompt changes to display that you're currently working in a virtual environment:
_10(VENV_NAME) ➜ langflow git:(main) ✗ -
To deactivate the virtual environment and return to your regular shell, type
deactivate
.When activated, the virtual environment temporarily modifies your
PATH
variable to prioritize packages installed within the virtual environment. To avoid conflicts with other projects, it's a good idea to deactivate your virtual environment when you're done working in it.To delete the virtual environment, type
rm -rf VENV_NAME
. This completely removes the virtual environment directory and its contents.
-
Navigate to where you want your virtual environment to be created, and create it with
uv
._10uv venv VENV_NAMEReplace
VENV_NAME
with a name for your virtual environment. -
Start the virtual environment:
_10VENV_NAME\Scripts\activateYour shell's prompt changes to display that you're currently working in a virtual environment:
_10(VENV_NAME) PS C:/users/username/langflow-dir> -
To deactivate the virtual environment and return to your regular shell, type
deactivate
.When activated, the virtual environment temporarily modifies your
PATH
variable to prioritize packages installed within the virtual environment. To avoid conflicts with other projects, it's a good idea to deactivate your virtual environment when you're done working in it.To delete the virtual environment, type
Remove-Item VENV_NAME
. This completely removes the virtual environment directory and its contents.
-
在您的虚拟环境中安装 Langflow:
_10uv pip install langflowTo install a specific version of the Langflow package by adding the required version to the command, such as
uv pip install langflow==1.4.22
.Reinstall or upgrade Langflow
To reinstall Langflow and all of its dependencies, run
uv pip install langflow --force-reinstall
.To upgrade Langflow to the latest version, run
uv pip install langflow -U
. However, the Langflow team recommends taking steps to backup your existing installation before you upgrade Langflow. For more information, see Prepare to upgrade. -
启动 Langflow:
_10uv run langflow runIt can take a few minutes for Langflow to start.
-
To confirm that a local Langflow instance is running, navigate to the default Langflow URL
http://127.0.0.1:7860
. -
Create your first flow with the Quickstart.
For upgrade information, see the Release notes.
For information about optional dependency groups and support for custom dependencies to extend Langflow OSS functionality, see Install custom dependencies.
下一步
- Quickstart: Build and run your first flow in minutes.
- Build flows: Learn about building flows.
- Troubleshoot Langflow: Get help with common Langflow install and startup issues.