1

I've placed package dependencies (wheels) of a Kedro project into a <project-root>/deps/*.whl directory. I'm using a venv installed into <project-root>/.venv and manage it using Poetry.

Packages are referenced in pyproject.toml like this (here e.g. local-package):

[tool.poetry.dependencies]
local-package = {path = "deps/local_package-X.Y.Z-py2.py3-none-any.whl"}

The package can be imported in a REPL session:

$ .venv/bin/python
Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import local_package
>>> 

In VSCode I've activated my venv and am running `kedro jupyter lab` to start jupyter lab. If I try to import the package it cannot be found (running `import local_package` in a notebook cell leads to `ModuleNotFoundError: No module named "local_package"`). If I run `!poetry show | grep local-package` in a notebook cell I get `local-package    X.Y.Z deps/local_package-X.Y.Z-py2.py3-none-any.whl`. The Python interpreter shown in Jupyter Lab is the project one. What do I have to do to get this working?
thinwybk
  • 4,193
  • 2
  • 40
  • 76
  • Does this work if you do `jupyter notebook` without anything `kedro` related? – Zain Patel Jun 05 '20 at 09:59
  • It sounds like kedro is not running in your venv environment. If you are not on windows you can find out where kedro runs from with `which kedro`. – akode Jul 28 '20 at 16:27

0 Answers0