ipython notebook hang when open a large notebook - jupyter-notebook

I am using the LATEST (2.2.0) ipython notebook, when I create a notebook with a loop to write many lines (about 20000 lines), then it run forever I guess since I always see the running icon at the top right. Even if I restart the computer and reopen the notebook again, it will into a running mode automatically, then I almost unable to do anything in this page. I have to copy the code and new another page to fix it.
How can I fix such hang issue during open a too large notebook? I have tried the kernel "interrupt" and "restart" menu and it seems no any effect at all.

IPython notebook is not intended to do such tasks with too much calculation or too many output data because actually such things is for standalone program rather than a notebook.
To fix such issues, you need to create a standalone application (script) to do it from console, then paste the meaningful result into IPython notebook.

Related

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 notebook is eating all my memory and then crashes

I have been getting involved with the Python language, and especially through Jupyter notebook. I think Jupyter is great for prototyping code in a very convenient way. I've been working on code according to this tutorial over the past 2 days:
https://medium.com/#omar.ps16/stereo-3d-reconstruction-with-opencv-using-an-iphone-camera-part-iii-95460d3eddf0, and it's been working fine.
However, when I woke up this morning, it seems that a memory issue is causing Jupyter to crash. When I start Jupyter, there is no such memory issue, it is only when I click on my particular notebook file. Then the memory gradually increases (as seen on the task manager). Also, the screen is non-reactive, so I cannot reach the restart kernel or any of these options in the kernel. After about 30 seconds, the entire Jupyter system crashes due to a memory overflow.
I would greatly appreciate any help with this problem.
Okay I figured out that I was printing a huge matrix out, which blocked up the system. I had to open the notebook with notepad++, and get rid of the data that way, and everything is running fine. Stupid mistake.

cant acces jupyter notebook variable from previous session

So, im playing around with jupyter notebook, and I have this code, that i wrote yesterday:
BUt the problem is, that when i try to acces my model object the next day. Jupyter does not allow me to do that
For some reason i am not able to acces the variables in cells that i wrote i a previous session. Why is this? and how do I circumvent?
If you shut down the Jupyter Notebook service this is to be expected. Your output and cell numbers are saved in the notebook, but objects actually do not stay in memory. Notice how you have In [4]: in both screenshots. This is because you restarted the service and the second screenshot shows your 4th run of that cell since the restart.
You need to rerun the entire notebook to load everything into memory. You can use Kernel> Restart & Run All from the top menu to do this automatically.

How to activate a debugger or access logs in Jupyter notebooks?

I am trying to run a R notebook on Microsoft's Azure notebooks cloud service.
When I am trying to run all cells, it displays a Loading required package: ggplot2 in the last cell and then the Kernel systematically crashes. I get:
The kernel appears to have died. It will restart automatically.
But the Kernel does not restart automatically.
How can I get a log describing the encountered issue? Is there a way to activate a debugger?
When you're running Jupyter usually you'll see messages about kernel issues in standard I/O of the console that you launch. In Azure Notebooks this gets redirected to a file at ~/.nb.log. You can open a new terminal by clicking on the Jupyter icon, and then doing New->Terminal, and doing cat ~/.nb.log. You could also start a new Python notebook for this purpose and do "!cat ~/.nb.log" - but unfortunately you can't just do that from an R notebook, they don't support the "magic" ! commands.
Usually that gives you a good starting point. If that doesn't help much you could try invoking R directly from the terminal and trying the repro steps there and see if that's more useful.

Possible to copy/paste from IPython Notebook to other apps?

I'm new to Ipython Notebook. I can cut and paste from other apps into my notebooks, but how do I copy/paste code out of notebook into a different app?
I'm accessing a Linux VNC session via Chicken. I can cut/paste with wild abandon between OSX/Linux using both command X/C/V and/or middle mouse button. I can also copy code into IPython notebook. I'm stopped dead in my tracks trying to get code out of IpyNotebook.
Using Notebook's 'Edit/Copy Cell' doesn't work, neither does 'Ctrl-m c'.
I'm running IPython 0.13.1
You have to select and copy code using normal Ctrl-C Ctrl-V. 'Edit/Copy Cell' is a specific action in javascript that does a little more and that browser security policy prevent us to bind with clipboard.

Resources