-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Better Message for xlrd Dependencies #28546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can I work on this? |
Sure! |
Can I work on this? I am new to contributing to issues on GitHub and this seems like a good start. |
I removed xlrd from versions and changed the default message to only include the pip install message like follows.
Is what I am doing correct? |
I changed the default engine to be openpyxl in pandas/io/excel/base to be openpyxl for the purpose of making the "default read_excel call with no engine argument" fall back to openpyxl. Also I added an error message to pandas/io/excel/_openpyxl for the purpose of directing "the user to install openpyxl first and foremost," Am I heading in the right direction? Is this OK? |
Don't want to make that change just yet - simply warn the user that the default will change in the future and they can explicitly say |
On it! thanks for the feedback |
take |
I'd like to work on this but this is my first time contributing to pandas as well as first time working with such a huge codebase. What general direction should i work in? |
@tab1tha / @SuvigyaJain1 are you still working on this? @WillAyd is this just a matter of modifying the 'read_excel' function and changing the default engine to openpyxl? Are there any checks that need to be done to see if the module is already installed? |
No I'm no longer working on this feel free to take the issue |
@WillAyd I took a look at the PR. I thought this would be a relatively easy fix by just adding a FutureWarning ExcelFile when using xlrd and/or just defaulting to openpyxl but looking at the reviews it seems to be more complicated than I thought. In my own fork, I just added that warning which works as expected when not specifying the engine. This would be my first contribution so I can use some guidance. |
I don’t think the existing PR is too far off just needs to be pushed over the finish line. If you pull that branch locally, fix the merge conflicts, and add a filter for the FutureWarning that is now getting raised at the module level of test_readers.py and test_xlrd.py I think should get you most of the way there: https://docs.pytest.org/en/latest/warnings.html#pytest-mark-filterwarnings |
So... I do have this error and I have xlrd installed. I tried to update xlrd and force-reinstall with pip and it doesn't work. I get |
Having the exact same problem. Wasn't happening on a different version of jupyter yesterday but now it is and I can't seem to use pip install. |
I think that for some reason the version of python called from that command is not the version on use: My system has python 2.7 as standard, and the virtual environment I'm using is 3.7. The errors were calling python2.7. So maybe someone hardcoded something like |
Yep. That’s what it was. Using pip3 to install and also installing openpyxl worked for me. |
I have the same problem, I removed xlrd and delete all xlrd folder in C:\Users\anaconda3\Lib\site-packages |
I am new to python. What did you install using pip3? could you please explain more thoroughly? Thanks. |
When you are in a virtual environment of python3, pip is the same as pip3. source path/to/your/env/bin/activate
command -v pip
# path/to/your/env/bin/pip
command -v pip3
# path/to/your/env/bin/pip3
ls -l path/to/your/env/bin/pip*
# -rwxrwxr-x 1 user group 242 Feb 7 08:50 /home/user/path/to/your/env/bin/pip*
# -rwxrwxr-x 1 user group 242 Feb 7 08:50 /home/user/path/to/your/env/bin/pip3*
# -rwxrwxr-x 1 user group 242 Feb 7 08:50 /home/user/path/to/your/env/bin/pip3.6*
md5sum /home/user/path/to/your/env/bin/pip*
# e85ad2c43787183884634c694a4f9c15 /home/user/path/to/your/env/bin/pip
# e85ad2c43787183884634c694a4f9c15 /home/user/path/to/your/env/bin/pip3
# e85ad2c43787183884634c694a4f9c15 /home/user/path/to/your/env/bin/pip3.6 |
I'm still getting the same issue as above. Running an anaconda environment with pandas=1.3.0 and xlrd=1.2.0 Using pd.read_excel returns "ImportError: Missing optional dependency 'xlrd'. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd." |
If you are using
It might be the case that you are getting this error only in
|
I believe this bug is obsolete now that openpyxl has become the only engine for xlsx files. |
ImportError: Pandas requires version '1.2.0' or newer of 'xlrd' (version '1.1.0' currently installed). |
Right now if you don't have
xlrd
installed and useread_excel
without specifying theengine
keyword you get the following message:This is in spite of the fact that the user may have openpyxl installed and could do something like
pd.read_excel(..., engine="openpyxl")
to get the same code to workTwo issues need to be addressed here:
read_excel
call with noengine
argument should fall back toopenpyxl
, if installedThe text was updated successfully, but these errors were encountered: