Downloading Jupyter Notebooks Part IIks

When I attempt to download a Notebook as Notebook I get a json file that cannot be opened with Jupyter. If I download it as .py, I get and html. More in general, I don’t understand the relationship between the folder where the Workspace documents reside and the local computer folders. This lack of knowledge makes it very difficult to transition from Coursera Workspace to my own.

The py file downloads as HTML because browser sees the HTML tags inside cell1 and cell2 and therefore suggests HTML extension. However, it still is a Python file - just rename it after download.

Or to override the browser suggested extension, change the file extension in download dialog box and use double quotes around the file name, i.e. use “”. Now it should download as a file with .py extension.

1 Like

The change in extension to py works. However, jpynb extension does not result in a Jupyter Notebook. Thanks anyway

The “.json” file that you get when you download “as notebook” is fine. All you have to do is rename it to have the “.ipynb” extension. Or you can do the “Download” from the file explorer view that you get by clicking “File → Open” from the notebook.

I missed addressing the json file part from your post.

A “*.ipynb” file is a JSON file internally. The browser in that case is suggesting JSON extension because it thinks it is a plain JSON file. You can similarly rename that downloaded JSON file to ipynb and it should work, or force ipynb extension while downloading.

It all comes down to browser suggesting an extension based on the content of that file - if it sees text with some html tags inside it suggests “.html” extension, and if it detects JSON key/value data structure in the file it suggests “.json” extension.

I followed the advice: File–>Open–>Upload renamed–>Open with Jupyter. Still got a text file. What did I do wrong? Thanks Paul, Vj.

It looks like you misspelled the “extension” when you renamed the file. Yours has “jpynb”. The correct extension for the notebooks is “ipynb”.

1 Like
  1. Open notebook
  2. Once it loads go to “File–> Open…”
  3. Select the checkbox next to the assignment name and then press “Shutdown”.
  4. Once it shutdowns (the green colour will turn dull)
  5. Select the check box next to the assignment name again and press “Download”
1 Like

also know you won’t be able to download files >100mb