2015-07-09 22 views
21

Ich installierte pandas und matplotlib unter Verwendung pip3 install. Ich lief dann dieses Skript:Warum habe ich xlrd nicht?

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

und erhielt diesen Fehler:

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' 

Warum ist die notwendige xlrd fehlt?

+0

Lustig. Ich habe überprüft und ich habe xlrd installiert. 'Die folgenden Pakete werden aktualisiert: xlrd: 0.9.3-py34_0 -> 1.0.0-py34_0' –

Antwort

18

"Es ist eine optionale Abhängigkeit pandas.pydata.org/pandas-docs/… Sie können es separat installieren." - (bernie, in einem jetzt-deleted kommentiert.)

+0

Ich habe eine Community-Wiki-Antwort erstellt, falls OP zurückkommt und etwas akzeptieren möchte. –

23

das neue Modul installieren:

pip install xlrd 
Verwandte Themen