Skip to content
Advertisement

Python Relative Import in Jupyter Notebook

Let’s say I have the following structure:

JavaScript

In, code.ipynb, I simply want to access a function inside functions.py and tried this:

JavaScript

I get the error:

JavaScript

I have checked a bunch of similar posts but not yet figured this out… I am running jupyter notebook from a conda env and my python version is 3.7.6.

Advertisement

Answer

In your notebook do:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement