Python: how to import func from the nested subdir

Viewed 19

I have a project with the following structure

app
├── app
│   └─- __init__.py
│   └── file.py
└── notebooks
    └── notebook.ipynb

I try to import func inside notebook.ipynb

I use from app.file import func_name but it returns me

ModuleNotFoundError: No module named 'app'

Then I added path into sys with sys.path.append('/app') and it returns

ModuleNotFoundError: No module named 'app.file'

How did I do wrong?

0 Answers
Related