8

I'm using django-pyexcel to export data from the website, but when I go to the export URL I get the error:

Exception Type: IOError

Exception Value: No content, file name. Nothing is given

The code to export the data was copied from the example given in the documentation:

return excel.make_response_from_a_table(Question, 'xls', file_name="sheet")
Community
  • 1
  • 1
Tony
  • 9,672
  • 3
  • 47
  • 75

2 Answers2

18

The problem turned out to be the file format used, xls in this case.

I had only installed the xlsx (pyexcel-xlsx) processor so it did not know how to handle the xls file format.

The exception message could have been a bit better as I spent ages trying to figure out if there was a problem with the filename I'd supplied.

Tony
  • 9,672
  • 3
  • 47
  • 75
3

I had the same problem using Flask app. Try installing the following requirements:

numpy==1.21.0
openpyxl==3.0.7
pandas==1.3.0
pyexcel-xlsx==0.6.0
XlsxWriter==1.4.4