Unreadable Notebook: NotADirectoryError(20, 'The directory name is invalid') - jupyter-notebook

I created a Jupyter notebook inside a virtualenv environment and worked fine in the first session. However, when I tried to open the notebook again, I got the error titled Error loading notebook saying Unreadable Notebook: 'Path' NotADirectoryError(20, 'The directory name is invalid'), where 'Path' is just the local path of the notebook.
I'm able to open the notebook using Colab and it works fine. Also, it is saved inside a folder that is synced by Google Drive.
How can I open my notebook with Jupyter again?
A print screen of the error:
Thanks
I have tried reinstalling Jupyter Notebook, but the error persists.

Related

Prevent jupyter console from reading code from jupyter notebook

When on jupyter console and I hit the up arrow key, I'd like to go to the previously run line of code on that console. However it will read a previously run cell from a jupyter notebook instead. Is there a way to prevent this from happening?

Repare jupyter Notebook

Is there a way to repare a jupyter notebook. I can't open the notebook anymore.
I am having the following error when trying to open it.
Unreadable Notebook: path/to/notebook.ipynb UnicodeDecodeError('utf-8', b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x15\x18\x00\x00\x0e\x10\x08\x06\x00\x00\x00\x83\xba\xacA\x00\x00\x009tEXtSoftware\x00Matplotlib version3.3.3,
....
invalid start byte'
The same error happens when opening the notebook in lab or notebook.
Other notebooks open without problem.

error loading jupyter notebook permission denied: ipynb

I was working in a jupyter notebook until it froze. It wouldn't save or shut down so I restarted my computer. I launched jupyter notebook from an anaconda prompt, my folder directory opens per usual. When i tried to open the notebook from before, I get an error loading screen that says permission denied: (name of notebook).ipynb. I hit close and the notebook shuts down.
I checked the folder permissions, I have full control. I can create a new ipynb without any issues. I can open other notebooks without any problem in the same folder. I tried to run a trust notebook through the anaconda prompt and it says the notebook is missing.
I need to recover this particular notebook as it has all my work. Help! Any ideas? Thanks in advance.
I work in the anaconda prompt in an environment other than the root, so this answer using sudo chmod doesn't work for me.
I had possibly the same problem. In my case the problem was that jupyter notebook must have crashed or had some problem whilst autosaving.
As a result, in the folder where the notebook is saved there's a temporary file called ".~nameofnotebook.ipynb".
This file didn't show up in jupyter notebook, but only in the explorer. I deleted the notebook file and renamed the temporary file to delete the ".~" prefix. Make sure to save a copy of the notebook file before deleting anything in case your problem is different.
The renamed temporary file opens fine and none of my data was lost.
Change the name of the file and you are good to go bro..

Nothing shows up when i run Jupyter notebook

When i run jupyter notebook it just shows up blank
I checked Console for errors and it showed me this:
Console error message
This is the line that the above Error message is referring to:
Error message line
Here is the URL bar if you need it (this is what the URL bar shows when i launch Jupyter notebook):
URL
used
jupyter nbconvert --to script object_detection_tutorial.ipynb
to convert .ipynb to .txt, then copied the code to a .py file

Repair corrupted Jupyter notebook / load previous version?

I had a hardware crash while running a Jupyter notebook. After repairing the system and trying to restart the notebook, I got the following error message:
Error loading notebook
Unreadable Notebook: D:\Eddy\Documents\1604 Udacity\1612 Self-driving car Nanodegree\P4\P4 Eduard van Kleef.ipynb NotJSONError("Notebook does not appear to be JSON: ''...",)
Does anyone know of a way to revert to any of Jupyter's previous 'checkpoints'? Or of a way to at least partially restore a JSON?
If you are lucky then the ipynb file is corrupted but still there. In that case you can try opening it in a text file and copying the contents to a new notebook. But check the size of the file. If it is zero bytes, then there is nothing there!
This actually happened to me when my server ran out of memory and somehow the notebook got completely erased. Totally sucks.
Try this
jupyter nbconvert filename.ipynb --clear-output
It worked for me since it has corrupted because of Plotly behavior with some big data.
in your file directory that contains your ipynb file there is a folder called '.ipynb_checkpoints'. this folder does not show in the jupyter application so find it through windows explorer.
inside there's will be a file called urfilenamehere-checkpoint.ipynb
copy paste it to your file directory and open through the jupyter application it should probably work.
if your corrupted file is 0B, you definitely have to rely on the checkpoints.
do not create a new notebook with the same name it will overwrite the checkpoint.

Resources