相关文章推荐
耍酷的人字拖  ·  IntelliJ IDEA 的 Code ...·  1 年前    · 
坚强的遥控器  ·  java 读取dat文件-掘金·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am going through the openpyxl documentation and cannot get load_workbook to work from openpyxl import
wb = load_workbook(path.xlxs)

OUTPUT:

wb = load_workbook('path.xlsx') NameError: name 'load_workbook' is not defined

Other openpyxl methods are working fine. Verson 3.0.1

Have removed and reinstalled using pip. Thanks,

@TheMob this doesn't work because when you just run import openpyxl , you have to tag openpyxl before using the functions it provides. For example, this works as well: import openpyxl and on the next line wb = openpyxl.load_workbook('path.xlsx') Enrico Florentino Nov 22, 2019 at 4:27
import openpyxl 

should also work (at least for Python 3), however to use the load_workbook method you need to type:

openpyxl.load_workbook(YourFilePath)
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.