Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why don't I have xlrd?

I installed pandas and matplotlib using pip3 install. I then ran this script:

import pandas as pd import matplotlib.pyplot as plt data = pd.ExcelFile("Obes-phys-acti-diet-eng-2014-tab.xls") print (data.sheet_names) 

and received this error:

dhcp-169-233-172-97:Obesity juliushamilton$ python3 ob.py Traceback (most recent call last):   File "ob.py", line 4, in <module>     data = pd.ExcelFile("Obes-phys-acti-diet-eng-2014-tab.xls")   File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pandas/io/excel.py", line 169, in __init__     import xlrd  # throw an ImportError if we need to ImportError: No module named 'xlrd' 

Why is the necessary xlrd missing?

like image 428
jukhamil Avatar asked Jul 09 '15 22:07

jukhamil


People also ask

How do I know if I have xlrd?

You've almost got it: xlrd. __VERSION__ . Usually it's useful to see available attributes and methods by calling dir: dir(xlrd) . This is extremely useful to know.

Why does xlrd no longer support Xlsx?

xlsx files was removed from xlrd due to a potential security vulnerability.

Is xlrd part of pandas?

Pandas uses the xlrd as their default engine for reading excel files. However, xlrd has removed support for anything other than xls files in their latest release. This causes you to receive the error that the xlsx filetype is no longer supported when calling the read_excel function on a xlsx excel using pandas.


1 Answers

Install the new module:

pip install xlrd 
like image 124
Arthur D. Howland Avatar answered Sep 22 '22 02:09

Arthur D. Howland