Good evening, everyone. My name is Jay, and I am new to the Jupyter Community.
Currently, I am working on a notebook, and I am having issues with downloading it. For some reason, it keeps saving as a PDF. I continuously try to save it as a notebook, but this does not work. It keeps saving as a PDF File.
I need to download it as a notebook to add it to GitHub. Does anyone know how I can fix this? Please help, the screenshot below is proof I am saving it as a notebook… yet it still keeps downloading as a PDF. I have uninstalled and reinstalled several times. I have also cleaned the cache
Is this a local jupyter lab/notebook server or what are you using?
The dialog you are showing is not how you trigger a download of the .ipynb
file.
I don’t know about jupyter notebook but in jupyter lab you download files from the file explorer sidebar by right-clicking and choosing Download
.
If you are using the Save and export notebook as
function from the File menu, the notebook gets converted to whatever format you select there (I guess that is what you are doing).
I am hitting the download button and it keeps automatically downloading as a PDF. I am not manually selecting PDF, it is doing it on its own
A couple of suggestions to work around it while you are still trying to sort it out:
-
In your Jupyter session you should be able to right-click and choose to open the Jupyter .ipynb
file with the text editor built into Jupyter instead of just clicking or double clicking on it. If that works, you may be able to do a select all and copy that text out of the editor in your Jupyter session and then paste it into a proper coding text editor (nothing made by Microsoft unless it is VSCode) on your own machine & then save it with the .ipynb
extension.
-
Are you sure it is actually a PDF format though that saves and the wrong extension isn’t getting added somewhere in the process? You should be able to check by opening it in a text editor on your local machine. If you direct a text editor to open it, is it .ipynb
json text file? Or is it acutally PDF file where the top of the file will look something like this below?
%PDF-1.4
%âãÏÓ
15 0 obj
13974
endobj
14 0 obj
<</Type /XObject
/Subtype /Image
/Width 200
/Height 200
/Filter /FlateDecode/BitsPerComponent 8
/ColorSpace /DeviceRGB /Length 15 0 R
>>
stream
xÚí]y\ÎÙ÷7cŒ±ûYkÈšF–±|³eëÊ2ˆ„A–˜,eß"’={vY’HÆ.Æš²MD–d
‰ì;3üÞ¯îËyÝ
...
This part has me confused. If you are expecting to ‘download’ then you’d be working on a remote machine. And if that were so, you cannot be uninstalling and reinstalling. Something isn’t adding up about all that.
If you are running this on your own machine then you don’t need to download, except if JupyterLite is involved (see below). If you are using Jupyter installed on your own machine then it will be saving the .ipynb
file on your system as you work and you just need to locate where that is. Type in your notebook in a new cell the following three letters and execture that:
pwd
That should give you the path where the text-based .ipynb
file is presently located on your machine. (Something to keep in mind in relation to this is that others have found OneDrive being involved can make sorting this out more confusing than normal.)
Caveat:
If JupyterLite is involved here, …
Note you can usually tell if it is JupyterLite if you have a kernel that is either Python (Pyodide)
or possibly Python 3.11 (XPython)
(see here), in the kernel indicator in the upper right side of the screen. (Assuming you are working with Python on this stuff.) Your screenshot didn’t include that part and so I’m not sure.
If JupyterLite is involved here, you also wouldn’t be uninstalling and reinstalling.
But the real reason I add this is because this would be a case where you’d running Jupyter on your system (the computation actually runs deep in your browser’s inner workiings using WebAssembly), but at this time still need to act like there is a remote machine involved and ‘Download’ the file out of JupyterLite into your system’s typical file hierarchy. At this time, you cannot directly access the file system JupyterLite is using internally.
Minor comment: Some of these details/issues/concerns, I raise could have been spelled out in the original post. Usually advisable to say how you installed things or were you are working because there’s a lot of ways to work with Jupyter these days as you maybe can gather from my discussion here.
1 Like