-
Python: Kedro supports macOS, Linux, and Windows and is built for Python 3.8+. You'll select a version of Python when you create a virtual environment for your Kedro project.
-
Virtual environment: You should create a new virtual environment for each new Kedro project you work on to isolate its Python dependencies from those of other projects.
-
git: You must install
git
onto your machine if you do not already have it. Typegit -v
into your terminal window to confirm it is installed; it will return the version ofgit
available or an error message. You can downloadgit
from the official website.
- The core Kedro Framework supports all Python versions that are actively maintained by the CPython core team. When a Python version reaches end of life, support for that version is dropped from Kedro. This is not considered a breaking change.
- The Kedro Datasets package follows the NEP 29 Python version support policy. This means that
kedro-datasets
generally drops Python version support beforekedro
. This is becausekedro-datasets
has a lot of dependencies that follow NEP 29 and the more conservative version support approach of the Kedro Framework makes it hard to manage those dependencies properly.
We strongly recommend installing conda
as your virtual environment manager if you don't already use it.
[Read more about virtual environments for Python projects](https://realpython.com/python-virtual-environments-a-primer/) or [watch an explainer video about them](https://youtu.be/YKfAwIItO7M).
The recommended approach. From your terminal:
conda create --name kedro-environment python=3.10 -y
The example below uses Python 3.10, and creates a virtual environment called kedro-environment
. You can opt for a different version of Python (any version >= 3.8 and <3.12) for your project, and you can name it anything you choose.
The conda
virtual environment is not dependent on your current working directory and can be activated from any directory:
conda activate kedro-environment
To confirm that a valid version of Python is installed in your virtual environment, type the following in your terminal (macOS and Linux):
python3 --version
On Windows:
python --version
To exit kedro-environment
:
conda deactivate
Depending on your preferred Python installation, you can create virtual environments to work with Kedro using venv
or pipenv
instead of conda
.
Click to expand instructions for venv
If you use Python 3, you should already have the venv
module installed with the standard library. Create a directory for working with your project and navigate to it. For example:
mkdir kedro-environment && cd kedro-environment
Next, create a new virtual environment in this directory with venv
:
python -m venv .venv
Activate this virtual environment:
source .venv/bin/activate # macOS / Linux
.\.venv\Scripts\activate # Windows
To exit the environment:
deactivate
Click to expand instructions for pipenv
Install pipenv
as follows:
pip install pipenv
Create a directory for working with your project and navigate to it. For example:
mkdir kedro-environment && cd kedro-environment
To start a session with the correct virtual environment activated:
pipenv shell
To exit the shell session:
exit
To install Kedro from the Python Package Index (PyPI):
pip install kedro
You can also install Kedro using conda install -c conda-forge kedro
.
To check that Kedro is installed:
kedro info
You should see an ASCII art graphic and the Kedro version number. For example:
If you do not see the graphic displayed, or have any issues with your installation, check out the searchable archive of Slack discussions, or post a new query on the Slack organisation.
The best way to safely upgrade is to check our release notes for any notable breaking changes. Follow the steps in the migration guide included for that specific release.
Once Kedro is installed, you can check your version as follows:
kedro --version
To later upgrade Kedro to a different version, simply run:
pip install kedro -U
When migrating an existing project to a newer Kedro version, make sure you also update the kedro_init_version
:
- For projects generated with versions of Kedro > 0.17.0, you'll do this in the
pyproject.toml
file from the project root directory. - If your project was generated with a version of Kedro <0.17.0, you will instead need to update the
ProjectContext
, which is found insrc/<package_name>/run.py
.
- Kedro can be used on Windows, macOS or Linux.
- Installation prerequisites include a virtual environment manager like
conda
, Python 3.8+, andgit
. - You should install Kedro using
pip install kedro
.
If you encounter any problems as you set up Kedro, ask for help on Kedro's Slack organisation or review the searchable archive of Slack discussions.