ImportError:加载excel格式文件需要openpyxl

时间:2018-03-21 12:13:57

标签: python excel python-2.7 openpyxl psychopy

我在Windows 10 64位上使用anaconda spyder 2.7。我也在使用心理软件。有一个错误,说要加载excel格式文件需要openpyxl。我已经安装了openpyxl,但仍然存在相同的错误。我还尝试修改data.py第29行:

from 
openpyxl.cell import get_column_letter 
into:
openpyxl.utils import get_column_letter

但没有区别。 我发给你代码和追溯。如果有人可以解决这个错误,那将非常有用。

base_dir =  os.path.normpath('C:\\Users\\ravikumar.mevada\\Gustometer\\qmix\\examples')
conditions_file = os.path.join(base_dir, 'fat_taste.xlsx')
data_dir = os.path.join(base_dir, 'Data_out_fat')
outfile = os.path.join(data_dir,'output_fat_taste')

#import .xlsx file
conditions = data.importConditions(conditions_file)

#screen resolution #TODO: not used
width = GetSystemMetrics(0) 
height = GetSystemMetrics(1)

#assign to each taste a specific pump
tastants_pumps = {'sweet1':pump_1,'sweet2':pump_3,'sweet3':pump_4, 'water':pump_5}
Traceback (most recent call last):

 File "<ipython-input-9-291e52893b5d>", line 7, in <module>
conditions = data.importConditions(conditions_file)

 File "C:\Users\ravikumar.mevada\Anaconda2\lib\site-packages\psychopy\data.py", line 2667, in importConditions
 raise ImportError('openpyxl is required for loading excel '

 ImportError: openpyxl is required for loading excel format files, but it was not found. 

0 个答案:

没有答案