How to reopen Jupyter notebook if I closed the tab? - jupyter-notebook

This is an extremely basic question. At some point I accidentally closed the window containing my Jupyter notebook tabs. It's gone from my 'recently closed tabs' in Chrome. Is there some way that I can reopen the notebooks corresponding to the currently active kernels?
In case it makes a difference, they are julia kernels, and I started the notebook server by typing notebook() in a julia REPL session.

If your server is still running, you can still see all previously opened notebooks:
Access your dashboard via the browser (usually http://localhost:8888 by default).
Select the Running Tab (as mentioned by #Quang Hoang).
Example

As the same happened to me and the first google result was this entry, here is some additional information:
When following the url posted above (http://localhost:8888), you may be asked for a password or token, the latter of which you will find either in the Jupyter terminal window (also providing you with the direct notebook url):
Jupyter terminal screenshot
, or, if using Anaconda, by opening the "Anaconda Prompt" and entering jupyter notebook list.

Related

'_xsrf' argument missing from POST - Need a Permanent Fix - Other Suggested Solutions are Not Working

Every time I open Jupyter Lab from Anaconda, I receive the following error: '_xsrf' argument missing from POST.
I am using Google Chrome on Windows 10.
I've followed the suggestions from the other posts, e.g. copy and paste the URL into different Chrome tab and refresh the page.
It seems like my sessions are not properly closing, even if I terminate all kernels for that specific session.
I've closed all Jupyter Lab sessions by using jupyter notebook stop <session_number>. Nothing has changed.
Someone has suggested revising the configuration. However, I am unclear as to what problems a reconfiguration will cause downstream.
One last thing, I do NOT encounter this problem when running Jupyter Notebook. The error only occurs when I open Jupyter Lab.

close Google Chrome accidentally and variables in jupyter notebook are missed

I accidentally closed Google Chrome while running jupyter notebook, and when I restart jupyter notebook again, the variables I got from my previous run are gone, what should I do?
Unfortunately the variables are not saved when you close instances of Jupyter notebook. They are gone. The code is saved automatically every now and then (or manually when you do it yourself). But if that hasn't happened in a while, you'll need to rerun the code to re-generate the variables.

Jupyter Lab, R kernel - Wanted: to prevent Jupyter from opening the R help server

Unfortunately, I made a change to the Jupyter Lab settings recently. Jupyter had never been able to access the remote R help server. Usually this was never an issue because most help files are displayed in Jupyter. The way help is called on a function or method is typing: ?question. The "question" being the name of an R function or method. Ex. ?plot
Infrequently one of the R packages will not list its help in Jupyter and instead try to open the remote R help server. This has never worked in the past. The tab for a remote server never opened. This has never really been an issue until recently. Recently I decided to "fix" this issue and spent a good deal of time looking up the solution. I made this "fix" and Jupyter began working properly to open the remote R help server. But the fix is a problem that is way too obnoxious.
Each time I type the question mark in Jupyter, Jupyter causes the browser to open a new tab for the remote R help server. It is impossible to type fast enough after typing typing the ?. Once the ? is typed, the typing is interupted while the browser opens a new R server help website. As soon as returning to the typing, another browser tab opens and interrupts the typing .
It is impossible to finish typing the name of a function after the ? without having multiple interruptions to the typing while multiple new windows are opened in the browser at the R help server website. By the time I've finished typing: ?ppp, there will the 5 interruptions and new browser tabs opened. If I typed slowly, there may be 10 - 12 interruptions and 10 new tabs opened at the R help server.
How to prevent Jupyter from trying to access the remote R help server every time the ? is typed when looking up a description of a function? How to get back to that happy place I had before I'd made whatever change that caused this nightmare to happen?
Solved my own question.
This issue had nothing to do with R. I assumed I had changed a configuration in R, but that was not the case. This was an issue I had caused when I had changed a setting in Jupyter lab.
I can say with certainty this issue was definitely caused when I changed the "Contextual Help" setting under the Commands tab in Jupyter. This setting is related to the Contextual Help selection found under the Help tab. And this setting was causing multiple R help server tabs to open in the browser after I typed: ?
Upon rediscovering this Jupyter setting today I recalling that I had been down this path before. I selected "Contextual Help". Jupyter auto restarted and the issue went away. I can gladly say that I can perform search again for the description of an R function: Ex ?plot ,and receive the description of this function within Jupyter the same as before. I no longer have the issue of the browser opening or multiple new tabs at the remote R help server after typing ?

Impossibily to run Jupyter notebook from Windows start menu and required tokens

I am a novice in the use of Python and I am using PandasBiogeme to estimate discrete choice models.
My issue is related to the Jupyter notebook. Usually when I wish to use it, I select it from the start menu of Windows 7 and automatically a new tab opens up in Chrome.
Yesterday, actually by not knowing exactly why, I logged out from Jupyter notebook and today when I launched it from the start menu the following error message appeared:
I thus decided to reinstall Anaconda, and PandasBiogeme and to update both of them.
Now when I wish to open Jupyter notebook from the start menu a prompt menu appears and suddenly disappears. Therefore I need to open the Anaconda Powershell and type
jupyter notebook
Yet, when I do this I receive the same error message I reported above
I typed in the second URL and I was then able to work again.
Yet, when I close Jupyter notebook and try to launch it again the same problem arises and I have to insert again 'a' token. I wrote 'a' token, because if I select by chance the token reported at the following URL (which has nothing to do with my work)
https://jupyter-notebook.readthedocs.io/en/stable/security.html
namely, this one:
http://localhost:8888/?token=c8de56fa4deed24899803e93c227592aef6538f93025fe01
and then Jupyter notebook works and I can carry out my estimation.
I read different posts on the possibility to set a password to avoid problems related to tokens, but only the first time I inserted the token I had the option to insert a password in in a html page, but I decided not to do it. Now I believe it could be the case.
This is something that happened overnight, without, I believe, my doing anything specifically.
This issue is driving me crazy and I would be thankful if any of you had a potential suggestion.
Many thanks.
Marco

make a jupyter notebook run even if the page is closed

I love notebooks. I love them so much that I have many of them running at the same time, often in different browsers, sometimes on different remote clients. I miss one feature: when I close the tab corresponding to a running notebook, it warns that the corresponding run will be stopped.
My question:
How do I make a jupyter notebook resume it's run even if the page is closed ?
such that I can:
re-open the tab in another browser (possibly on a remote computer such as a tablet),
restart a browser when it needs to,
close those with long running time for later inspection.
From what I understand, the client-server architecture could make that possible, but that there may be issues with multiple concurrent runs...
PS: I created an issue on GitHub
In fact, this was answered in the github issue:
takluyver commented on 26 Apr 2017: Anything already running in the
notebook will keep running, and the kernel it started for that will
stay running - so it won't lose your variables. However, any output
produced while the notebook isn't open in a browser tab is lost; there
isn't an easy way to change this until we have the notebook server
able to track the document state, which has been on the plan for ages.
Thanks!

Resources