Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel not launching... the next day? #3492

Closed
eightsixtwo opened this issue Apr 3, 2018 · 12 comments
Closed

Kernel not launching... the next day? #3492

eightsixtwo opened this issue Apr 3, 2018 · 12 comments

Comments

@eightsixtwo
Copy link

Hi,

I'm teaching myself R (and Github and Anaconda and Jupyter) and I'm having an issue opening a note book I created. In fact I've created this notebook a couple of times because I thought I'd corrupted the first one but keep getting the same problem.

The file is very basic, pretty much just text with some math calculations - it doesn't import any modules and doesnt call on any datasets (I'm not doing anything that advanced yet). The file seems to be set up as a new notebook in Jupyter as normal, I can work normally on it and it can be saved as normal. All the code works without errors and I save before I deliberately close down the kernel at the end of the session... however when I come back to it on another day the notebook will not launch. There is a 'kernel' in the top right (instead of 'R') and a dark circle, also the browser seems to load forever until it timesout.

Any ideas how I can fix this?

I've tried updating to the latest release of Anaconda and Notebook. I'm running Win10 on an old laptop, which I thought was the root of the problem so I uploaded the .pynb file to the Anaconda cloud (where I can see the content of the file and it is all there), put Anaconda onto another Win10 machine, downloaded the .pynb file and then uploaded it to a new install of Notebook.... but the same issue occurs. :-/

Please send help.

Anth

Here's an image of the dark circle that taunts me... If you need me, I'm in the corner rocking back and forth.

image

@takluyver
Copy link
Member

Can you create a new file? It sounds like the issue may be with the file you saved. Did you run something that created a very large amount of output? Trying to display it all again might be overloading the browser. You can use nbstripout to remove output from a notebook but leave your code there.

If it is the file but not a large amount of output, is it something you can share with us so we can investigate it?

@eightsixtwo
Copy link
Author

Hi! Thanks for the response!

OK, I tried stripping out the file using the anaconda prompt - it was successful in stripping out the file but not sorting out the kernel issue. To the best of my knowledge there shouldn't be any large outputs created in my file but I'm willing to follow any advice given (it's greatly appreciated!).

Sure, I don't mind sharing the file - I can't share the .pynb file (not supported) so I've copied the exact same text from the file that exists in the Anaconda cloud and put it in a .txt file:
intro_to_r.txt

Hopefully you can see this too: [https://anaconda.org/eightsixtwo/intro_to_r_v2/notebook]

Thanks again for looking at this!

@takluyver
Copy link
Member

I was really after the .ipynb file, if you can figure out a way to share it. From the screenshot you posted, it looks like it's getting stuck loading the file, so I wondered if there was anything unusual about the file.

@eightsixtwo
Copy link
Author

Hmm. OK, I've put a copy of the file in Dropbox - here's a link to it: https://www.dropbox.com/s/dkf76ajb1dkhd1y/intro_to_r_v2.ipynb?dl=0

Let me know if this doesn't work and I'll see if there's another way of getting it over

Thanks again!!

@takluyver
Copy link
Member

Thanks, that does reproduce it. After a while, Firefox gives me the option to stop the page's Javascript, and then I get a traceback in the JS console. It looks like it's coming from the markdown parser.

Then I took the file and started deleting bits to see which bit was causing the problem. It's this paragraph:

Just to recap, a variable can be created to hold a value (e.g. x <- 42) however this will only hold one value - or at least a reference to only one. A vector will effectively allow multiple values to be references, similar to a list. A vector will contain values of the same data type (numeric, character, boolean).

I think the issue is with that < symbol. That could be the start of an HTML tag, and the regex that looks for that is getting stuck 'backtracking' - evaluating different possible ways to match the rest of the input after that. We use a Javascript parser called marked, and I think you've hit this bug: markedjs/marked#1058

For your side, the easiest fix is to make that R statement a bit of inline code, by putting backticks around it:

`x <- 42`

For our side, the bug has already been fixed in marked, so hopefully we just need to ensure that the next release of notebook bundles a newer marked. I'm trying to check that now.

@takluyver
Copy link
Member

Yup, rebuilding our Javascript with marked 0.3.19 solves the problem, so this will be fixed when we release notebook 5.5.

@takluyver takluyver added this to the 5.5 milestone Apr 3, 2018
@takluyver
Copy link
Member

I've also verified that this doesn't cause an issue for nbconvert, which processes markdown using the Python package mistune.

@eightsixtwo
Copy link
Author

And just like that I realise how much I do not yet know... That was very impressive! Thanks for fixing my issue!!

@takluyver
Copy link
Member

takluyver commented Apr 3, 2018

No worries! To clarify, you'll need to open the notebook in a text editor to edit that bit of markdown before it will load. If you're not sure how to do that, one way is to get the URL which tries to load it, and then change /notebooks/ to /edit/ - that will give you the very basic text editor that comes with Jupyter.

@eightsixtwo
Copy link
Author

Great! I'll do that. Thanks!

@eightsixtwo
Copy link
Author

IT WORKS!!!!!

You are a genius.

@takluyver
Copy link
Member

😎 😉

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants