Seems that relative import is implemented as relative to where the python.exe executed instead of the place where the file is.
So the nature is depending on where you run the doctest or where you put your jupyter notebook, all imports inside the project will break!
If you are writing anything more than a single file, a.k.a a module that has directories and subdirectories, which you will import in another place, you are supposed to put everything into a package format and install it with pip install -e ./
Then, within the module are free to use the absolute imports starting with the module name, or relative ones, and it all works like a charm. The import system is designed around this.
Alternatively, you can modify the PYTHONPATH env variable, or modify sys.path dynamically, to append to paths and import directly.