I’ve completed all the required parts of week 2 and completed them on time by Saturday. I am currently looking back at the optional parts at the end. I’m in the middle of the final lab, on PCA analysis. I noticed there’s a step where it’s necessary to add a
but the next function, and I’m not sure whether it’s custom or part of bokeh, is
plot_widget()
and it doesn’t load. I googled plot_widget and found the PlotWidget object, but it’s not spelled the same and it’s part of the class pyqtgraph, which we don’t have imported PlotWidget
I then decided, okay, I’ll try changing the notebook to Trusted and see if that makes it work. Maybe then it will run the custom code. I’ve had that work in the past. But in the mean time, I had accidentally evaluated three cells ahead of where I was. I figured, I’ll wait for them to run, and either all four will evaluate, or the first one will throw an error. Worst case, I will restart the kernel.
Then the notebook stopped loading and I can’t get it back. I can’t open any jupyter notebook on Coursera right now. Could someone please help?
I have checked that lab, and it is working correctly. None of the assets are missing.
Do not mess around with loading your own packages that you find online. Everything you need is provided in the Coursera Labs environment for this assignment.
First thing to try is to use “Lab Help” (the question-mark inside the circle, near the upper right corner of your browser), and then “Get latest version”. Then exit the lab and re-load it from the course. See if that makes the lab appear.
Once you get the lab to load:
If you have problems making the plot widget appear when you run those cells, then try changing your browser settings (disable any pop-up or ad blockers, etc.).
The plotting widget can be difficult to get working on some browsers and operating systems.
Then maybe someone else did, maybe it was the network, or maybe this was a case of “works on my computer (your computer)”, but it just wasn’t working on mine. In any case, I’m glad it is resolved, although I also did nothing in particular to fix it.
I don’t know what heals a jupyter notebook running on a server. Frankly I’m not too sure why they do and do not work a bit randomly on my own computer sometimes. It’s pretty obvious that if package were updated, it might break something, whether it’s the OS or within python or jupyter. But what if it’s just sitting there, and working on localhost? I’ve still had it go from working to broken then back to working, although in that case it took a really long time (and I did eventually install updates of course). I was using WSL for that circumstance, with ubuntu, but I have definitely had that scenario happen other times in my life programming as well. Didn’t change the code, ran it again, got a different result, or it won’t load, or something, when nothing changed about the environment as far as I know either. Speculating crazily, is some cybersecurity thing on my computer deciding my code is a virus, and to do the math wrong on purpose the second time its run, or to just hang forever, or not run it at all, when that happens?
Restarting the kernel pretty much just cleans up your workspace and gives you a fresh start (wipes out the memory storage, function definitions, global variables, etc).
It fixes things if you’ve been running notebook cells out of order, or if you’ve been modifying cells that manipulate a global object.
Some of the DLS courses (particularly Course 5) use a lot of global assets, and you have to be very careful there to restart the kernel every time you change a function that modifies a global object.
To be clear, because I’m confused about terminology. If I restart the jupyter python kernel, I assume I’m not restarting other people’s python environments at the same time when jupyter is run on a server?