0

我已将 Kedro 项目的包依赖项(轮子)放入<project-root>/deps/*.whl目录中。我正在使用安装到<project-root>/.venv并使用 Poetry 管理它的 venv。

包是这样引用的pyproject.toml(这里是 eg local-package):

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

可以在 REPL 会话中导入包:

$ .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?
4

0 回答 0