C3_W2_Assignment: Cannot open jupyter widget


When I ran the exercise cells, I believed a widget should pop up and let me submit my answers, but nothing showed up. The console reads, "Could not open comm – Error: Class jupyter.widget not found in registry ".

If this problem is hard to replicate, may I know the format of the answer json, such that I can directly write to the file bypassing the jupyter widget?

Nevermind. Just found that there is a “Lab Files” button on top of the page, which allows me to download utils.py and get access to the code that writes “answers.json”. Directly writing the json works for me.

btw, im facing the same issue.
how did u uploaded the json back?
coz ritnow i cant see any such option apart from download
Pls do help me

I just copied the code from utils.py and executed some of them in the jupyter notebook on the webpage. Basically, you need to maintain a global dict for all the answers. From utils.py you can find something like {"ex1": {"mu": 0.0, "var": 0.0}} or so. Just fill in your answers and update the global dict with your answers. Finally, dump the dict into the json file. Let me append the code snippets to this reply after work.

Btw, I have both Windows and Ubuntu on my laptop. After I switched from Windows to Ubuntu (I use Chrome on both of them), the widget works… I guess there could be some platform- or browser-dependent issues. Maybe the easiest way to solve the problem is to try using another browser.

Hi @SICHAO_YANG and @Lisha! I’m sorry you are facing this issue, it is very annoying. We have had reports of ipywidgets not behaving nicely with Safari but this is the first time I know of it not working for Windows/Chrome.

@Lisha could you let me know which OS/browser are you using? If switching browsers does not work I could provide an empty template of the json for you to fill out but ideally we could prevent this from happening to other learners.