I'm having some trouble with imports in Jupyter Notebook. My directory structure is as follows: https://i.stack.imgur.com/Bfxjx.png.
In my Cost function.ipynb
I wrote the following:
import numpy as np
import matplotlib.pyplot as plt
from lab_utils_uni import plt_intuition
plt.style.use('deeplearning.mplstyle')
However I got TypeError: the 'package' argument is required to perform a relative import for './deeplearning'
.
To try to fix this, I added '.'
in front of lab_utils_uni
like this:
from .lab_utils_uni import plt_intuition
But this resulted in ImportError: attempted relative import with no known parent package
.
How can I fix this issue?