Prerequisites
- A recent version of Python, at minimum v3.10.
- Recommended: a virtual environment manager like Poetry or pyenv for Python versions and dependencies.
- Recommended: Basic knowledge of Git.
1
Create a working root directory
To create the working directory, in a terminal window, run this command specifying the directory name:
2
Install the Cognite Toolkit from PyPi
The Cognite Toolkit is available as a Python package and can be installed with pip or Poetry, ideally by using a virtual environment.If you’re using a virtual Python environment manager, and you get a
- pip
- poetry
"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.If the installation fails, see the troubleshooting section.
3
Initialize the configuration files and modules
The Cognite Toolkit manages Cognite Data Fusion projects within an organization. You can find your organization name in the browser address when you sign in to CDF: This starts the interactive setup process to create the organization_dir directory and populate it with a set of configuration files and template modules to configure for your CDF projects.For each organization the most common setup is to have one project per environment. In this example, the organization is called “acme” and the environments are “dev” and “prod”:
https://<organization>.fusion.cognite.com.To initialize the configuration files and modules, run this command:4
Convert the working directory to a Git repository
To prepare for version control and collaboration, convert the working directory into a Git repository:The directory can now be version-controlled and is ready for further configuration. The
cdf repo init command adds a .gitignore file and a README.md file to the repository. Use the README file to document the purpose of the repository and the configuration files.5
Set up authentication and authorization
See the authentication and authorization article.
Troubleshooting
In Windows environments, you might get this error:ERROR: Could not install package due to an OSError: [Errno 2] No such file or directory: ....
The Cognite Toolkit comes installed with built-in modules. These modules are part of a directory structure that can exceed the Windows limit of 260 characters for a file path, depending on the location where you install the toolkit.
To enable support for long paths, see the maximum path length limitation article.