Estava importando o conteúdo da aula 2 do curso, que tem os seguintes códigos:
df_xlsx = pd.read_excel('dados/aluguel.xlsx')
df_xlsx
Porém acontece um erro:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
~\anaconda3\envs\alura_pandas\lib\site-packages\pandas\io\excel.py in __init__(self, io, **kwds)
260 try:
--> 261 import xlrd
262 except ImportError:
ModuleNotFoundError: No module named 'xlrd'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-18-9c7a007bdf8c> in <module>
----> 1 df = pd.read_excel('dados/aluguel.xlsx')
~\anaconda3\envs\alura_pandas\lib\site-packages\pandas\util\_decorators.py in wrapper(*args, **kwargs)
116 else:
117 kwargs[new_arg_name] = new_arg_value
--> 118 return func(*args, **kwargs)
119 return wrapper
120 return _deprecate_kwarg
~\anaconda3\envs\alura_pandas\lib\site-packages\pandas\io\excel.py in read_excel(io, sheet_name, header, skiprows, skip_footer, index_col, names, usecols, parse_dates, date_parser, na_values, thousands, convert_float, converters, dtype, true_values, false_values, engine, squeeze, **kwds)
228
229 if not isinstance(io, ExcelFile):
--> 230 io = ExcelFile(io, engine=engine)
231
232 return io._parse_excel(
~\anaconda3\envs\alura_pandas\lib\site-packages\pandas\io\excel.py in __init__(self, io, **kwds)
261 import xlrd
262 except ImportError:
--> 263 raise ImportError(err_msg)
264 else:
265 ver = tuple(map(int, xlrd.__VERSION__.split(".")[:2]))
ImportError: Install xlrd >= 0.9.0 for Excel support
Os outros arquivos foram importados com sucesso (json, txt).