I’m running a notebook in JupyterLab and want to import a module contained in the same folder as the notebook. The file structure:
notebooks/
|___ notebook.ipynb
|___ some_module.py
It works in terminal: I can import some_module
and use its functions from both python3
and ipython
.
Inside the .ipynb I can import some_module
, meaning that the module is on the sys.path
and gets found. But if I call e.g. function some_module.f()
I get module 'some_module' has no attribute 'f'
. I can’t access any function from some_module
at all.