hey folks - I've got a python module named databa...
# questions
c
hey folks - I've got a python module named database sitting in the same repo as my kedro project. I can't seem to get it recognized. tried using hooks, altering the PYTHONPATH but nothing. just ModuleNotFoundError. any idea how I can overcome? • database/ • kdr_project/ ◦ src/ ▪︎ project/ • pipelines/ ◦ mypipeline/ ( file in here is where I am importing database
j
hi @charles ! The PYTHONPATH trick should work, but it’s not very sustainable. however, in your tree database/ would be a package, not a module (that would be database.py)
this is more of a Python question, nothing here is specific to Kedro
c
PYTHONPATH isn't working. I pip install the package now. Works locally. In our container I can import the package from the python interpreter but the kedro pipeline itself is giving ModuleNotFound. What could be going on here?
j
PYTHONPATH
trick works for me with the same structure you have
c
i'm stumped
Untitled
that's my Dockerfile. maybe you can spot what the problem is?
j
@charles if your import statement is
import db
, then
PYTHONPATH
should be
/home/kedro_docker
c
this saved my butt last night @Juan Luis i cannot thank you enough
🥳 1
j
happy to help! 😄