Recovering Jupyter Notebook files after computer crashed? - python

I use Jupyter Notebooks (run through Anaconda) to code in Python. Last week, my computer crashed (not really sure the exact reason), I sent it for repairs and got it back and it has been basically completely reset and now all my apps/files are gone (repair invoice says a "part" was replaced, but not what part).
My question: is there any way to recover my jupyter notebook files or are they completely gone? I've seen instructions to recover accidentally deleted notebooks but not sure if there is a way to recover files after a computer crash. I am using Windows if that helps at all.
If it's not possible to recover these files, what is the best way to back them up in the future? I was under the impression that since jupyter notebooks opened on a web browser, the files would be stored on some sort of cloud, but it appears that is not the case.

Related

Move exercise from Vocareum to a local PC running Anaconda Notebook

This is the Vocareum screen from my class.
We are encouraged to download the project to a local instance of Anaconda Navigator Jupyter Notebook and work there. I am attempting to determine how to do this. I am running Windows 11 and the current version of Jupyter Notebook version 6.4.12. There is a respected response on stackoverflow here but I do not know if it applies to Windows and, if so, on what screen(s) to make the entries.
The link to the Vocareum exercise is here. There does not seem to be a download control, though there is an upload button. I need all four folders:
assets
data
resource
DirectMailAdvertising.ipynb
I have been able some months ago to download the ipynb file without the assets, data, and resource files but, of course, that does not allow the exercise to run. I did this by opening the notebook, going to File/Download as/Notebook.ipynb

Jupiter notebook stuck

I am trying to open a Jupyter notebook I have done, but since when I uploaded a huge dataframe it is stuck like this:
I don't know what to do actually. I have tried to ctrl+C (force quit) jupyter and restart it again several times. I have an important code there. Is there a way to recover it or open the page? I know it's not very much info. This notebook is stored in an anaconda environment and for the moment I did nothing but trying to open it....it looks like jupyter is very slow down.
EDIT: it looks like it is very memory expensive...
Thank you,
Federico
Jupyter notebooks are actually JSON files, so you can open them with plain text editors. Presumably, your browser is having a hard time rendering the notebook - opening it in a text editor won't render anything at all, so you should be able to read the code.
This will allow you to back up the code of the notebook.

Trusting a notebook is not working in PyCharm

I want to run a Jupyter notebook in PyCharm but on cells that are executing javascript, I get the message, that the notebook is not trusted.
When I click the "Trusted" checkbox, the arrow appears for a second and then disappears again. The notebook stays untrusted. Also using the command-line interface for Jupyter with
jupyter trust notebook.ipynb
doesn't work.
When I open the notebook on the browser with the same kernel running, it works just fine.
I also want to add that I have three projects open at the same time. When I just open the project, which is containing the notebook, I can click the "Trusted" checkbox and it will stay checked, but still, the javascript cells will not execute.
Maybe that's a bug, but probably I messed up some settings? Can you help me find out, which settings I can change and if there are other options to get the notebook trusted within the IDE?
Have a nice day!
I had the same problem when I moved the notebook's directory. What solved it for me in PyCharm was to copy and paste the notebook's content into a new file.
I came across this issue when specifying %matplotlib notebook.
Changing this to %matplotlib inline got the plotting to work.
Not fully understanding the issue or how this solves it but it is sufficient for my application.

how to open jupyter projects on anyother IDE like vs_code

I am working with Juypter Notebook for a long time and I want to open my projects in vs_code (or any other IDE) and my "juypter_projects" folder where I contain all my Jupyter notebook projects appears in this way: (please try to understand my handwriting 😀😁)
and inside the .ipynb_checkpoints folder which is located inside the juypter_projects folder seems in this way:
and looks like none of the files inside these folders are of .py extension
hence so I dont know which file should I choose to open when trying to edit my code in other IDEs
and so when I tried to open them in any IDE like vs_code it is not working and this limits me to only edit my code inside "Juypter Notebook" and please tell me how can I open Juptyer Notebook projects and edit them in other IDEs... Thank You
When you write code in Jupyter cells, the notebook (.ipynb) is converted into a JSON object, making it very difficult to work in an IDE.
The solution my company landed on is writing everything in external python modules and importing them into the notebook. We use Jupyter widgets extensively and they can be imported into .py files as easily as importing them into notebooks. In the end, we get a library of custom widgets and modules that can be used by everyone, and since it's just python, we can build/edit in any IDE. I use Sublime.
There may be other ways, but this approach works so well for us that we've stopped looking for alternatives.

Make Jupyter Notebook clickable

I did develop an application for several users on windows, without internet access using python and Jupyter Notebook as a graphical interface.
The application intend to process some data, they just have to copy paste the path to their datafile and run through different step.
As a user they just want to double click somewhere to open it. I may not fully understand Jupyter Notebook but I would like to find a simple way to make the notebook clickable ...
Could you help me ?
Thx
Have you looked at nteract? It was a suggestion in a similar question here, that was linked from a question with a similar title as yours, but referenced the previous version of the tech that is now Jupyter notebook.

Categories