I am trying to read a .xlsx
with pandas, but get the follwing error:
data = pd.read_excel(low_memory=False, io=\"DataAnalysis1/temp1.xlsx\").fillna(
This happened to me after I ran a script with cProfile a la python3 -m cProfile script.py
even though xlrd was already installed and had never thrown this error before. it persisted even under python3 script.py
. (Granted, I agree this wasn't what happened to OP, given the obvious import error)
However, for cases like mine, the following fixed the issue, despite being told "requirement already met" in every case.
pip install --upgrade pandas
pip install --upgrade xlrd
Pretty confounding stuff; not sure if cProfile was the cause or just a coincidence
The following should work, assuming your pip install
operated on python2.
python3 -m pip install xlrd