langflow/docs/docs/Develop/install-custom-dependencies.md
April I. Murphy 332738a317
docs: Build out Troubleshooting and Support documentation (#8662)
* change luna to enterprise support

* community page updates

* combine issues and discussions pages

* move telemetry out of contribute

* remove gerund title

* rewrite issues page

* fix 2 anchors

* add troubleshooting page

* move troubleshooting and extras from install

* add some more issues

* coderabbit
2025-06-23 16:16:40 +00:00

3.2 KiB

title slug
Install custom dependencies /install-custom-dependencies

Langflow provides optional dependency groups and support for custom dependencies to extend Langflow functionality.

Install optional dependency groups

Langflow OSS provides optional dependency groups that extend its functionality.

These dependencies are listed in the pyproject.toml file under [project.optional-dependencies].

Install dependency groups using pip's [extras] syntax. For example, to install Langflow with the postgresql dependency group, enter the following command:

uv pip install "langflow[postgresql]"

To install multiple extras, use commas to separate each dependency group:

uv pip install "langflow[deploy,local,postgresql]"

Install custom dependencies

To install your own custom dependencies in your Langflow environment, add them with your package manager.

If you're working within a cloned Langflow repository, add dependencies with uv add because there is already a pyproject.toml file for uv to reference:

uv add langflow DEPENDENCY

Use a virtual environment to test custom dependencies

When testing locally, use a virtual environment to isolate your dependencies and prevent conflicts with other Python projects.

For example, if you want to experiment with matplotlib with Langflow:

# Create and activate a virtual environment
uv venv YOUR_LANGFLOW_VENV
source YOUR_LANGFLOW_VENV/bin/activate

# Install langflow and your additional dependency
uv pip install langflow matplotlib

If you're working within a cloned Langflow repository, add dependencies with uv add to reference the existing pyproject.toml file:

uv add langflow matplotlib

Add dependencies to the Langflow project

When contributing to Langflow itself, add dependencies to the project's configuration.

Langflow uses a workspace with two packages:

  • The main package (root level): For end-user features and main application code
  • The base package (in src/backend/base): For core functionality and shared code

Dependencies can be added in different groups:

  • Regular dependencies: Core functionality needed to run the package
  • Development dependencies: Tools for testing, linting, or debugging are added in the [dependency-groups.dev] section
  • Optional dependencies: Features that users can optionally install are added in the[project.optional-dependencies]

There are three ways to add a package using make commands:

  • Add to main package dependencies (for end-user features):
make add main="matplotlib"
  • Add to development tools (for testing, linting, debugging):
make add devel="matplotlib"
  • Add to base package dependencies (for core functionality):
make add base="matplotlib"

You can also add these dependencies manually to the pyproject.toml file:

[project]
dependencies = [
    "matplotlib>=3.8.0"
]
  • Or as an optional dependency:
[project.optional-dependencies]
plotting = [
    "matplotlib>=3.8.0",
]

The make commands add the dependency with uv add and update the uv.lock file in the appropriate location.