Jupyter Notebook kernel restarting and 404 Rest code

Hey community,

I’m trying to run get an in-house Jupyter project running, but I’m getting Kernel Restarts and 404 error code messages. Also my Python process quits unexpectedly

My command: jupyter notebook notebooks/<my notebook>.ipynb

I’m on Mac and Python 3.11. Also tried with different Python environment. Always the same behavior.

I’m clueless at this point.

What if you start Jupyter up without specifying a particular .ipynb file? Does that work


Please always paste in errors that are supplied in text form on your machine as errors in text form here, too.

Please read Getting good answers to your questions. Pay particular attention to the admonition ’ DO NOT post images of code, data, error messages, etc’, under the section ‘Help others reproduce the problem’, in the link to How do I ask a good question? at the bottom there.

For pasting it in so it is readable, you’ll want to learn about ‘block code formatting’ here. (Or see about ‘fenced code blocks’ here. They are both the same thing if you look into the details. They just have slightly different terms used in the two locations.)

At least does not restart nor output the 404 errors.

So is it working otherwise? If so can you save a new notebook and the copy the notebook you want to run to where the new one just saved?

As soon as I open a notebook, the issue reproduces. The same behavior when opening a notebook by navigating the file system on the browser (jupyter notebook without a notebook).

Also tried downloading the Lorenz example and opening it with Jupyter. I’ve downloaded it to a different location from my notebooks. I tried it to discard problems with my notebooks, but I get the same behavior.

Have you searched around on this forum for recent Mac advice? I’m not seeing an obvious way to go on this at this time.
Alternatively…

Are you limited in any way as to what you can use? A lot of times letting the Anaconda Distribution handle things is easier. Then you can open the Anaconda Navigator, choose Jupyter, and things should work. Some people are against that because you then should learn how to manage your projects using conda; however, it can be a challenge to novices.

Thank for answering, @fomightez. Yes, I’ve search around here and there, not a very common issue.

Are you limited in any way as to what you can use?
I’m on a corporate Mac, so, I think somehow yes, but I can install softwares.

Hey, I finally got it fixed. This article explains how to solve the kernel restart issue on Mac M1.

The solution
Edit the ipykernel/eventloops.py file from your site-package.

Your site-package is the directory where pip installs the packages. It is linked to the Python version. For instance:
/Users/<your user>/.pyenv/versions/3.9.4/lib/python3.9/site-packages/ipykernel/eventloops.py

Find the return sentence of the the_use_appnope() function. It should look like this:
return sys.platform == "darwin" and V(platform.mac_ver()[0]) >= V("10.9")

Append and platform.mac_ver()[2] != 'arm64', leaving the return line like this:

return sys.platform == "darwin" and V(platform.mac_ver()[0]) >= V("10.9") and platform.mac_ver()[2] != 'arm64'

It should get the issue fixed.

1 Like