Problems and solutions of typeerror: ‘generator’ object is not subscriptable in openpyxl

Today, a package called openpyxl was used to parse the excel data to build the driver data framework.
Then the TypeError:’generator’ object is not subscriptable bug

appeared . The specific problem in the above picture appeared in print(pe.getCellOfObject(sheet, rowNo=1 , colsNo=1)) After
checking the code for a long time, there is no problem. Finally, I asked Du Niang to find out that it was the version number.
Since I installed the version of openpyxl3.0.0, I just need to replace the 2.3.3 or 2.3.5 version.

Solution: 

It is recommended to change the version of openpyxl to 2.3.3 or 2.3.5

 

Similar Posts: