As @COLDSPEED so eloquently pointed out the error explicitly tells you to install xlrd.
pip install xlrd
And you will be good to go.
Answer from Grr on Stack OverflowAs @COLDSPEED so eloquently pointed out the error explicitly tells you to install xlrd.
pip install xlrd
And you will be good to go.
Since December 2020 xlrd no longer supports xlsx-Files as explained in the official changelog. You can use openpyxl instead:
pip install openpyxl
And in your python-file:
import pandas as pd
pd.read_excel('path/to/file.xlsx', engine='openpyxl')
» pip install xlrd
I had a similar issue. I got the same error. However i do not have Anaconda installed. I managed to solve the issue with the below upgrade.
pip install --upgrade xlrd
I had the same issue with another package in Spyder. I solved it with pip install. Did you try that already?
You have not downloaded xlrd module.
Python has certain modules and libraries that need to be installed on top of the built-in packages. For installing modules using pip, use the syntax pip install [module_name] where you can also put the version number(optional) specifically required for your usage with [module_name]==[version_no]
Try using pip install xlrd==1.1.0. That will install your module in your local Python system.
If you want details, the documentation for this module can be found here :
For latest version (2.0.1) - https://pypi.org/project/xlrd/
For your required version (1.1.0) - https://pypi.org/project/xlrd/1.1.0/
You missed the dependency, below is the command to install it.
pip install xlrd
You can install openpyxl using pip install openpyxl and then try:
pd.read_excel('2018_pressures.xlsx', engine='openpyxl')
This is an alternative solution but it will work.
I share with you my experience on this !
- step check whether you have the following excel packages installed: openpyxl, odf, xlrd
to check:
pip list or conda list
If there is no installation package reading the excel file, then install one of them with this method:
pip install xlrd, pip install openpyxl, pip install odf or pip install pyxslb
for conda : conda install xlrd, conda install openpyxl, conda install odf, conda install pyxslb
then check again whether your file reads correctly:
dataFrame = pd. read_excel('C:/.../.xlsx', engine= 'openpyxl')
if it gives an error again, it means that you are using another interpreter to read the code if you want to read it in https://www.kaggle.com/abdumaleek/kasco-tasks/editkaggle or in collaboration, then you need to install the package for reading exel file again
for example, in kaggle :
!pip install openpyxl
import openpyxl
df = pd. read_excel('C:/.../.xlsx', engine= 'openpyxl')
this is 100% should work support with a like
I am on Mac machine(Catalina -version 10.15.5) and below pip3 command worked for me.
pip3 install xlrd
python version : 3.7.6
OS : Mac-Catalina(10.15.5)
Thanks to @Tapan Hegde, pip3 install xlrd worked from me, after installing the pip3, like this:
sudo apt update
apt install python3-pip
pip3 install xlrd