dlt-runtime
dlt-runtime provides the `dlt` command-line interface (CLI) for the `dlt` data loading library. It allows users to initialize, run, deploy, and manage data pipelines built with `dlt`. The current version is 0.24.1, and it follows the frequent release cadence of the main `dlt` library, often with multiple minor releases per month.
Common errors
-
dlt: command not found
cause The `dlt-runtime` package, which installs the `dlt` CLI executable, was either not installed or not installed in an environment whose `bin` directory is on your system's PATH.fixEnsure `dlt-runtime` is installed (`pip install dlt-runtime`). If it is, verify your shell's PATH includes the Python `Scripts` or `bin` directory where `dlt` is installed. For virtual environments, ensure the environment is activated. -
ModuleNotFoundError: No module named 'dlt'
cause You installed `dlt-runtime` and are trying to `import dlt` but the `dlt` core library might be missing or corrupted, or you're trying to import from `dlt_runtime` directly.fixWhile `dlt-runtime` depends on `dlt`, ensure the `dlt` package itself is correctly installed. If you are importing, always use `from dlt import ...`. If the error persists, try reinstalling `pip install dlt` (which `dlt-runtime` will pull anyway). -
ERROR: dlt-runtime has requirement Python '>=3.9.2,<3.15', but you have Python 3.8.10 which is incompatible.
cause Your current Python environment does not meet the version requirements specified by the `dlt-runtime` package.fixUpgrade your Python version to a compatible one (e.g., 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 but not 3.15+) or switch to a Python environment that satisfies these requirements. Using `pyenv` or `conda` can help manage multiple Python versions.
Warnings
- gotcha Common confusion: `dlt-runtime` provides the `dlt` CLI command, while the core Python library for building pipelines is the `dlt` package. While `dlt-runtime` depends on `dlt`, programmatic imports for pipeline development should always be `from dlt import ...`, not `from dlt_runtime import ...`.
- breaking The `dlt` ecosystem (and thus the `dlt` CLI provided by `dlt-runtime`) is under active development. Frequent releases may introduce breaking changes, especially in major or minor versions, related to destination configurations, pipeline resource definitions, or CLI command syntax.
- gotcha Python version compatibility. `dlt-runtime` has specific Python version requirements (e.g., `>=3.9.2, <3.15` for version 0.24.1). Using an unsupported Python version will lead to installation or runtime errors.
Install
-
pip install dlt-runtime
Imports
- pipeline
from dlt_runtime import pipeline
from dlt import pipeline
Quickstart
# 1. Initialize a dlt project (e.g., using duckdb destination) dlt init duckdb_pipeline duckdb # 2. Navigate into the created project directory cd duckdb_pipeline # 3. Modify the pipeline script (e.g., duckdb_pipeline.py) if needed # For example, to load data from a source: # from dlt import pipeline, dlt_source # from my_source import my_data_source # # @dlt_source # def my_source(): # yield [1, 2, 3] # Replace with actual data loading # # @pipeline(pipeline_name='duckdb_pipeline', destination='duckdb') # def my_pipeline(): # my_source() # Load data from the source # 4. Run the pipeline dlt run duckdb_pipeline.py # 5. Check the status or deploy the pipeline dlt status