求助py3使用openpyxl报错:AttributeError: module ‘numbers‘ has no attribute ‘Number‘怎么解决,附代码

代码:

import openpyxl
wb =openpyxl.load_workbook("xht.xlsx")
sheet = wb.active['python']
res = sheet.cell(row=1,column=1).value
print(res)

报错信息:C:\Users\Administrator\AppData\Local\Programs\Python\Python37\python.exe C:/Users/Administrator/Desktop/工具/study/sj/seleniumtext/class7_excel.py
1
2
3
4
5
[1, 2, 3, 4, 5]
Traceback (most recent call last):
  File "C:/Users/Administrator/Desktop/工具/study/sj/seleniumtext/class7_excel.py", line 2, in
    import openpyxl
  File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages\openpyxl\__init__.py", line 4, in
    from openpyxl.compat.numbers import NUMPY
  File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages\openpyxl\compat\__init__.py", line 3, in
    from .numbers import NUMERIC_TYPES
  File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages\openpyxl\compat\numbers.py", line 3, in
    from decimal import Decimal
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\decimal.py", line 3, in
    from _decimal import *
AttributeError: module 'numbers' has no attribute 'Number'

你可能感兴趣的:(python)