Dependencies¶
Both pip install kedro
and conda install -c conda-forge kedro
install the core Kedro module, which includes the CLI tool, project template, pipeline abstraction, framework, and support for configuration.
When you create a project, you then introduce additional dependencies for the tasks it performs.
Project-specific dependencies¶
You can specify a project’s exact dependencies in the src/requirements.txt
file to make it easier for you and others to run your project in the future,
and to avoid version conflicts downstream. This can be achieved with the help of pip-tools
.
To install pip-tools
in your virtual environment, run the following command:
pip install pip-tools
To add or remove dependencies to a project, edit the src/requirements.txt
file, then run the following:
pip-compile --output-file=<project_root>/src/requirements.txt --input-file=<project_root>/src/requirements.txt
This will pip compile the requirements listed in
the src/requirements.txt
file into a src/requirements.lock
that specifies a list of pinned project dependencies
(those with a strict version). You can also use this command with additional CLI arguments such as --generate-hashes
to use pip
’s Hash Checking Mode or --upgrade-package
to update specific packages to the latest or specific versions.
Check out the pip-tools
documentation for more information.
Note
The src/requirements.txt
file contains “source” requirements, while src/requirements.lock
contains the compiled version of those and requires no manual updates.
To further update the project requirements, modify the src/requirements.txt
file (not src/requirements.lock
) and re-run the pip-compile
command above.
Install project-specific dependencies¶
To install the project-specific dependencies, navigate to the root directory of the project and run:
pip install -r src/requirements.txt