Hi Team, I'm just getting started with kedro in Py...
# questions
f
Hi Team, I'm just getting started with kedro in Pycharm IDE. For this, I set up a new project and added the python scripts of my previous project as source root. I managed to set up a first running pipeline and to run it within a jupyter notebook. Now the problem: When i want to visualize the pipeline from command line (kedro viz) inside the project folder, apparently the imported source root is not found. However, I can visualize it with line magic %kedro_viz from inside the notebook. I feel like both ways of visualization should work. Did i set up the project in a wrong way?
1
n
Are you referring to the “mark as source root” feature in Pycharm? that has no effect on the terminal
If you want to run any kedro project command (i.e.
run
,
viz
), you need to
cd
to the project directory, where the
pyproject.toml
exists. and run the corresponding command
f
Yeah i did that. Within my nodes, I am importing a local module from outside the project (that's why I added it to source root in pycharm). Exactly that module cannot be found. Do I somehow need to add it inside pyproject.toml?
n
If you are using module from outside of the project, technically it should be an external library and you should install it.
pip install -e .
is one way of doing it. Or the more hacky version of adding the path to
sys.path
(Which I believe is what the “mark as source root” does)
This is just Python complaining not finding the module, not specific to Kedro
The “add to source root” only has effect when you click the “Run/Debug” button with PyCharm IDE, thus it doesn’t work when you run in the terminal.
👍 1
f
Thank you!
🎉 1