[Issue]: Error loading excel file after pip install into existing environment
aliefink opened this issue · 4 comments
Description
Cannot load excel file into conda environment after pip installing pyEM. First error was “Missing optional dependency ‘xlrd’. Install xlrd >= 1.0.0 for Excel support Use pip or conda to install xlrd.” After installing xlrd the error became: "XLRDError: Excel xlsx file; not supported"
Please select any relevant labels.
No response
Other information
No response
Can you also add your code used to produce this error?
Adding "engine='openpyxl'" to pd.read_excel fixed the issue (isn't needed for newer pandas versions, but is for pandas==1.1.5).
Original code was:
"subj_list = pd.read_excel(f'{swb_dir}/data/subjects.xlsx', sheet_name='full_subj_test', usecols=[0])"
After installing pyEM I needed to do:
"subj_list = pd.read_excel(f'{swb_dir}/data/subjects.xlsx', sheet_name='full_subj_test', usecols=[0],engine='openpyxl')"
Thanks - closing this issue!