Installation prerequisites

Virtual environments

The main purpose of Python virtual environments is to create an isolated environment for a Python project to have its own dependencies, regardless of other projects. We recommend you create a new virtual environment for each new Kedro project you create.

Depending on your preferred Python installation, you can create virtual environments to work with Kedro as follows:

  • With conda, a package and environment manager program bundled with Anaconda

  • Without Anaconda, using venv or pipenv

conda

Install conda on your computer.

Create a new Python virtual environment, called kedro-environment, using conda:

conda create --name kedro-environment python=3.7 -y

This will create an isolated Python 3.7 environment. To activate it:

conda activate kedro-environment

To exit kedro-environment:

conda deactivate

Note

The conda virtual environment is not dependent on your current working directory and can be activated from any directory.

venv (instead of conda)

If you use Python 3, you should already have the venv module installed with the standard library. Create a directory for working with Kedro within your virtual environment:

mkdir kedro-environment && cd kedro-environment

This will create a kedro-environment directory in your current working directory. Next, to create a new virtual environment in this directory, run:

python -m venv env/kedro-environment  # macOS / Linux
python -m venv env\kedro-environment  # Windows

Activate this virtual environment:

source env/kedro-environment/bin/activate # macOS / Linux
.\env\kedro-environment\Scripts\activate  # Windows

To exit the environment:

deactivate

pipenv (instead of conda)

Install pipenv as follows:

pip install pipenv

Create a directory for the virtual environment and change to that directory:

mkdir kedro-environment && cd kedro-environment

Once all the dependencies are installed, to start a session with the correct virtual environment activated:

pipenv shell

To exit the shell session:

exit