ron
ron

Reputation: 125

Read excel file in Django views using pandas module

I'm trying to read an excel file using pandas in a views method.

But the server stopped with:

File "/Users/ronsair/anaconda3/lib/python3.6/site-packages/py/_error.py", line 44, in __getattr__
    raise AttributeError(name)    
AttributeError: __name__

Code:

import pandas as pd

def extract(request):
  df = pd.read_excel('update.xlsx')
  return render(request, "work/index.html")

Can you help please?

Upvotes: 0

Views: 537

Answers (1)

ron
ron

Reputation: 125

This was fixed after updating Pandas package from 0.22.0 to 0.25.3.

Upvotes: 1

Related Questions