My folder structure is set out like this:
- project/
- notebooks/
- notebook1.ipynb
- src/
- module1.py
- __init__.py
- data/
- data.csv
Such that I can separate my source code from the actual analysis. I would like to be able to import modules from src
and use them in notebook1
, however whenever I open notebook1
, Jupyter decides to change my working directory to be inside notebooks
.
This makes my imports harder to maintain as I'd have to import things relatively to Jupyter's whim - is there any way I can fix the cwd
such that it is always project
, no matter what file I have open?
I have looked through the docs and my ~/.jupyter/jupyter_notebook_config.py
, file but have found nothing that could help me.
EDIT: I'd like to not have to use os.chdir
or cd
at the top of every script.
Thanks for any help