我使用pip3 install
安裝了pandas
和matplotlib
。然後我跑這個腳本:爲什麼我沒有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)
,並收到此錯誤:
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'
爲什麼是必要的xlrd
失蹤?
滑稽。我檢查了一下,我安裝了xlrd。 '下面的軟件包將被更新: xlrd:0.9.3-py34_0 - > 1.0.0-py34_0' –