简体   繁体   中英

Cannot figure out this error in python 3Traceback (most recent call last): File “<stdin>”, line 1, in <module> NameError: name 'xlrd' is not defined

I have installed xlrd successfully, however, on attempting to use a command of xlrd:

xlrd.open_workbook('datafile.xls')

I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'xlrd' is not defined

I cannot understand this error and how to rectify it.

Try

importing xlrd with:

from xlrd import *

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM