栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

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

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

求助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:UsersAdministratorAppDataLocalProgramsPythonPython37python.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:UsersAdministratorAppDataRoamingPythonPython37site-packagesopenpyxl__init__.py", line 4, in
    from openpyxl.compat.numbers import NUMPY
  File "C:UsersAdministratorAppDataRoamingPythonPython37site-packagesopenpyxlcompat__init__.py", line 3, in
    from .numbers import NUMERIC_TYPES
  File "C:UsersAdministratorAppDataRoamingPythonPython37site-packagesopenpyxlcompatnumbers.py", line 3, in
    from decimal import Decimal
  File "C:UsersAdministratorAppDataLocalProgramsPythonPython37libdecimal.py", line 3, in
    from _decimal import *
AttributeError: module 'numbers' has no attribute 'Number'

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/269443.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号