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 Workbook
Error No module named'xlwings.xlwings'`from xlwings import Workbook
报错 cannot import name ‘Workbook’ from ‘xlwings’from openpyxl import workbook
报错 name ‘xlwt’ is not definedimport 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.