Skip to main content

Install Langflow

You can deploy Langflow either locally or as a hosted service with Datastax Langflow.

Install Langflow locally

Install Langflow locally with pipuv, or pipx.

Prerequisites

Install Langflow with pip or pipx

Install Langflow with pip:


_10
python -m pip install langflow

Install Langflow with uv:


_10
uv pip install langflow

Install Langflow with pipx using the Python 3.10 executable:


_10
pipx install langflow --python python3.10

Run Langflow

  1. To run Langflow, enter the following command.

_10
python -m langflow run

To run Langflow with uv, enter the following command.


_10
uv run langflow run

  1. Confirm that a local Langflow instance starts by visiting http://127.0.0.1:7860 in a Chromium-based browser.

Now that Langflow is running, follow the Quickstart to create your first flow.

Manage Langflow versions

To upgrade Langflow to the latest version, use the pip upgrade command.


_10
python -m pip install langflow -U

To upgrade Langflow to the latest version with uv, use the uv pip upgrade command.


_10
uv pip install langflow -U

To install a specific version of the Langflow package, add the required version to the command.


_10
python -m pip install langflow==1.1

To reinstall Langflow and all of its dependencies, add the --force-reinstall flag to the command.


_10
python -m pip install langflow --force-reinstall

DataStax Langflow

DataStax Langflow is a hosted version of Langflow integrated with Astra DB. Be up and running in minutes with no installation or setup required. Sign up for free.

Common installation issues

This is a list of possible issues that you may encounter when installing and running Langflow.

No langflow.__main__ module

When you try to run Langflow with the command langflow run, you encounter the following error:


_10
> No module named 'langflow.__main__'

  1. Run python -m langflow run instead of langflow run.
  2. If that doesn't work, reinstall the latest Langflow version with python -m pip install langflow -U.
  3. If that doesn't work, reinstall Langflow and its dependencies with python -m pip install langflow --pre -U --force-reinstall.

Langflow runTraceback

When you try to run Langflow using the command langflow run, you encounter the following error:


_10
> langflow runTraceback (most recent call last): File ".../langflow", line 5, in <module> from langflow.__main__ import mainModuleNotFoundError: No module named 'langflow.__main__'

There are two possible reasons for this error:

  1. You've installed Langflow using pip install langflow but you already had a previous version of Langflow installed in your system. In this case, you might be running the wrong executable. To solve this issue, run the correct executable by running python -m langflow run instead of langflow run. If that doesn't work, try uninstalling and reinstalling Langflow with python -m pip install langflow --pre -U.
  2. Some version conflicts might have occurred during the installation process. Run python -m pip install langflow --pre -U --force-reinstall to reinstall Langflow and its dependencies.

Something went wrong running migrations


_10
> Something went wrong running migrations. Please, run 'langflow migration --fix'

Clear the cache by deleting the contents of the cache folder.

This folder can be found at:

  • Linux or WSL2 on Windowshome/<username>/.cache/langflow/
  • MacOS/Users/<username>/Library/Caches/langflow/

This error can occur during Langflow upgrades when the new version can't override langflow-pre.db in .cache/langflow/. Clearing the cache removes this file but also erases your settings.

If you wish to retain your files, back them up before clearing the folder.

Hi, how can I help you?