Pāriet uz galveno saturu

Install or upgrade the Cognite Data Fusion Toolkit

Follow the steps in this article to install or upgrade the Cognite Data Fusion (CDF) Toolkit command line interface (CLI) and modules.

Prerequisites

Before you install the CDF Toolkit, you need:

Install the CDF Toolkit

Follow these steps to install the CDF Toolkit CLI and initialize the configuration files and modules.

Step 1: Install the CDF Toolkit

  1. The CDF Toolkit is published as a Python package and can be installed with pip or Poetry, ideally by using a virtual environment. Open up a terminal and install the CDF Toolkit with:
pip install cognite-toolkit

This automatically installs compatible versions of all dependencies.

If you're using a virtual Python environment manager, and you get a "command not found" message in the terminal window, make sure you have activated the virtual environment, for example by using source .venv/bin/activate or Poetry.

Step 2: Initialize the configuration files and modules

To create a directory, <proj_dir>, for your CDF project configuration files and template modules, run this command in your terminal:

cdf-tk init <proj_dir>

This creates the <proj_dir> directory and populates it with a set of configuration files and template modules to configure for your CDF projects.

Upgrade the CDF Toolkit

Follow these steps to upgrade the CDF Toolkit CLI and modules to the latest version.

piezīme

The CDF Toolkit CLI and module must be the same version. If they're out of sync, the CDF Toolkit guides you on how to upgrade them to the same version.

Step 1: Upgrade the CDF Toolkit CLI

To upgrade the CDF Toolkit to the latest version, open up a terminal and run this command:

pip install --upgrade cognite-toolkit

To upgrade the CDF Toolkit to a specific version, for example a beta version, open up a terminal and run this command:

pip install cognite-toolkit==0.2.0b4

Replace 0.2.0b4 with the version you want to install.

Step 2: Upgrade the CDF Toolkit modules

To update the CDF Toolkit modules to be compatible with the installed version of the CDF Toolkit CLI:

  1. Open up a terminal and run this command:

    cdf-tk init --upgrade
  2. Follow the CDF Toolkit instructions to manually update the modules.

  3. In the \cognite_modules\_system.yaml file, update the version number in the cdf_toolkit_version section.