ImportError:无法导入名称'load_workbook'

时间:2017-03-12 21:36:49

标签: python-3.x pycharm

#! python3
    # readcensusExcel.py - Tabulates population and number of census tracts for
    # each county

    import openpyxl, pprint

    print('Opening excel file...')
    wb = openpyxl.load_workbook('censuspopdata.xlsx')
    sheet = wb.get_sheet_by_name('Sheet1')

C:\Python34\python.exe C:/Users/ohmiw/PycharmProjects/myproject/readCeususExcel.py
Traceback (most recent call last):
Ask again later
  File "C:/Users/ohmiw/PycharmProjects/myproject/readCeususExcel.py", line 5, in <module>
It is certain
    import openpyxl, pprint
  File "C:\Python34\lib\site-packages\openpyxl\__init__.py", line 30, in <module>
    from openpyxl.reader.excel import load_workbook
ImportError: cannot import name 'load_workbook'

Process finished with exit code 1

我真的不知道如何处理这个...我是Python的初学者。我像往常一样用openpyxl.load_workbook()编写代码,但是它说,ImportError:无法导入名称'load_workbook'。有人,请帮帮我。

0 个答案:

没有答案