Error resolution cannot import name'workbook' from'xlwt'

Following the previous article, a new error was reported after solving the problem of module'xlwt' has no attribute'workbook'. The following is the trial and error process:

  • Install the openpyxl package — the same error is reported after installation. Method source
  • Install the xlwings package-the same error is reported after installation. Method source
  • from xlwings.xlwings import WorkbookError No module named'xlwings.xlwings'`
  • from xlwings import Workbook报错 cannot import name ‘Workbook’ from ‘xlwings’
  • from openpyxl import workbook报错 name ‘xlwt’ is not defined
  • import xlwt from openpyxl import workbook workbook = xlwt.workbook(encoding = 'utf-8')Error module'xlwt' has no attribute'workbook' method source
  • Enthusiastic foreign netizens pointed out Note the capitalization of the name
  • However, I tried capitalization and still the name'xlwt' is not defined.
    At this point, I was suddenly blessed and found that the following code quoted xlwt...So, if you use a notebook/small screen to write code, don't increase the font size, otherwise the error line will not be seen. If the screen is small, just use jupyter.

Guess you like

Origin blog.csdn.net/weixin_44616447/article/details/111317821