2015-07-09 17 views
21

Ho installato pandas e matplotlib utilizzando pip3 install. Allora ho fatto funzionare questo script:Perché non ho xlrd?

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

e ricevuto questo errore:

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' 

Perché la necessaria xlrd manca?

+0

divertente. Ho controllato e ho installato xlrd. 'I seguenti pacchetti saranno AGGIORNATI: xlrd: 0.9.3-py34_0 -> 1.0.0-py34_0' –

risposta

18

"È una dipendenza opzionale pandas.pydata.org/pandas-docs/… È possibile installarlo separatamente." - (bernie, in un ormai cancellato commentato.)

+0

Ho creato una risposta wiki della comunità nel caso in cui OP ritorni e voglia accettare qualcosa. –

23

Installare il nuovo modulo:

pip install xlrd 
Problemi correlati