Receiving a 505 intenal server error when trying to ‘share and export’ a Notebook from the Anaconda Cloud editor.
Do you mean “Save and export”? What are you trying to export it as?
I have the same issue when I try to export and save a notebook from Anaconda cloud as PDF.
I can generate a link, but I need the PDF, since this is a submission.
Hey @rhodyapps, @Bernadette , thanks for using the Anaconda Community!
Wondering if you could confirm the following which might help us debug as I’ve tried and it seems to work okay, but there might be some niche cases stopping it from working.
- Which environment you are using for the notebook you’re trying to convert
- If you open a blank notebook with just
print("hello world")
does it still fail? - Which packages you’re importing to the notebook that is failing
Also, as a workaround (important you can submit your work!) you could use this bit of code (I just used the Anaconda Assistant, and it seems to work) to convert notebooks into a PDF. Just create a new notebook in the folder where your notebook is that you want to convert, and change the file names in the last line.
import nbformat
from nbconvert import PDFExporter
def convert_ipynb_to_pdf(ipynb_file, pdf_file):
# Read the notebook content
with open(ipynb_file, 'r', encoding='utf-8') as f:
notebook_content = nbformat.read(f, as_version=4)
# Create a PDF exporter
pdf_exporter = PDFExporter()
# Convert the notebook to PDF
pdf_data, _ = pdf_exporter.from_notebook_node(notebook_content)
# Write the PDF data to a file
with open(pdf_file, 'wb') as f:
f.write(pdf_data)
# Example usage
convert_ipynb_to_pdf('example_notebook.ipynb', 'output.pdf')
To use this code, replace 'example_notebook.ipynb'
with the path to your .ipynb
file and 'output.pdf'
with the desired output PDF file name.