@Cost Function Lab:ModuleNotFoundError

Hello Everybody, I am trying to work on “C1_W1_Lab04_Cost_function” by downloading the complete file on my system and while running the code:
{
import numpy as np
import matplotlib.pyplot as plt
%matplotlib widget
from lab_utils_uni import plt_intuition, plt_stationary, plt_update_onclick, soup_bowl
plt.style.use(‘./deeplearning.mplstyle’)
}
i am getting “ModuleNotFoundError” refrence to " get_ipython().run_line_magic(‘matplotlib’, ‘widget’)".
As I have stored my practice set in the same downloaded folder, How to resolve this issue?

Hello @Deependu_Ghosh, we encourage learners to use the coursera platform for all the labs and the assignments because it is the only environment in which we have tested the labs and the assignments. If you see a ModuleNotFoundError, it usually indicates that you need to install one or some Python packages to get through. If you see a package name, you might google about how to install it in your python environment.

Thank you @rmwkwok , I understand the provided lab facilities are meant to be used preferably and I am also doing so. For the purpose of extra practice in code writing, I am revisiting the course content on the regular Jupyter Notebook, while the errors occur.

I had followed the shown remedies to get rid of errors but it doesn’t work entirely. Meanwhile, I have taken a few screenshots for a better understanding of both of our parts.

Thanking you,



From the error message, the module missing is ‘lab_utils_uni’, which is one of the py file provided by the course. This means you have only downloaded the jupyter notebook without downloading the supporting .py files. You may find those .py files by clicking “File” > “Open” on the jupyter notebook’s menu bar on the coursera environment.

Thank You @rmwkwok , got it finally, after uploading all the files to my jupyter notebook environment. The code snippet is running without errors now.

no problem @Deependu_Ghosh!