Install Langflow
You can deploy Langflow either locally or as a hosted service with Datastax Langflow.
Install Langflow locally
Install Langflow locally with pip or pipx.
Prerequisites
- Python 3.10 to 3.12 installed
- pip or pipx installed
- Before installing Langflow, we recommend creating a virtual environment to isolate your Python dependencies with venv or conda
Install Langflow with pip or pipx
Install Langflow with pip:
_10python -m pip install langflow
Install Langflow with pipx using the Python 3.10 executable:
_10pipx install langflow --python python3.10
Run Langflow
- To run Langflow, enter the following command.
_10python -m langflow run
- Confirm that a local Langflow instance starts by visiting
https://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.
_10python -m pip install langflow -U
To install a specific version of the Langflow package, add the required version to the command.
_10python -m pip install langflow==1.1
To reinstall Langflow and all of its dependencies, add the --force-reinstall
flag to the command.
_10python -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__'
- Run
python -m langflow run
instead oflangflow run
. - If that doesn't work, reinstall the latest Langflow version with
python -m pip install langflow -U
. - 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:
- 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 runningpython -m langflow run
instead oflangflow run
. If that doesn't work, try uninstalling and reinstalling Langflow withpython -m pip install langflow --pre -U
. - 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 Windows:
home/<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.