Importing custom module into jupyter notebook

One can tell python where to look for modules via sys.path. I have a project structure like this:

project/
    │
    ├── src/
    │    └── my_module/
    │        ├── __init__.py       
    │        └── helpers.py
    ├── notebooks/
    │   └── a_notebook.ipynb
    ...

I was able to load the module like so:

import sys
sys.path.append('../src/')

from my_module import helpers

One should be able load the module from wherever they have it.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)