Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
386 views
in Technique[技术] by (71.8m points)

python - cannot import workbook in openpyxl

I have installed openpyxl in ubuntu.
now I am running the openpyxl with xlsx files.

While importing the module, it gives me the following error.

from openpyxl import Workbook
ImportError: cannot import name Workbook

Can anyone knows what I have to do to solve the problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I think you want:

from openpyxl import workbook # not Workbook

Note the capitalization of the name here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...