Estou com o seguinte código:
df_excel = pd.read_excel('dados/aluguel.xlsx')
df_excel
E com esse erro gigante:
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-9-9e4d509acf26> in <module>
----> 1 df_excel = pd.read_excel('dados/aluguel.xlsx')
2 df_excel
~\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
Porém já realizei a instalação desses arquivos no prompt do anaconda: conda install -c anaconda xlrd
conda install -c anaconda lxml
conda install -c anaconda html5lib
conda install -c anaconda beautifulsoup4
E também surgiu esse erro:
ImportError Traceback (most recent call last)
<ipython-input-11-8c3ab867f71b> in <module>
----> 1 df_html = pd.read_html('dados/dados_html_1.html')
2 df_html
~\anaconda3\envs\alura_pandas\lib\site-packages\pandas\io\html.py in read_html(io, match, flavor, header, index_col, skiprows, attrs, parse_dates, tupleize_cols, thousands, encoding, decimal, converters, na_values, keep_default_na)
913 thousands=thousands, attrs=attrs, encoding=encoding,
914 decimal=decimal, converters=converters, na_values=na_values,
--> 915 keep_default_na=keep_default_na)
~\anaconda3\envs\alura_pandas\lib\site-packages\pandas\io\html.py in _parse(flavor, io, match, attrs, encoding, **kwargs)
737 retained = None
738 for flav in flavor:
--> 739 parser = _parser_dispatch(flav)
740 p = parser(io, compiled_match, attrs, encoding)
741
~\anaconda3\envs\alura_pandas\lib\site-packages\pandas\io\html.py in _parser_dispatch(flavor)
695 else:
696 if not _HAS_LXML:
--> 697 raise ImportError("lxml not found, please install it")
698 return _valid_parsers[flavor]
699
ImportError: lxml not found, please install it
Porém aparentemente o resto está correto.