小编Fre*_*red的帖子

无法为以前有效的脚本运行 pd.read_excel

我无法让我的 python 脚本运行。澄清一下,它们以前确实有效,但现在不行,代码本身不是问题。每当我尝试运行一个时,我都会收到一条错误消息pd.read_excel(file)

Traceback (most recent call last):
  File "automated_cleaning.py", line 9, in <module>
    df = pd.read_excel(roster_file)
  File "C:\Users\"User"\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\util\_decorators.py", line 208, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\"User"\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\io\excel\_base.py", line 310, in read_excel
    io = ExcelFile(io, engine=engine)
  File "C:\Users\"User"\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\io\excel\_base.py", line 819, in __init__
    self._reader = self._engines[engine](self._io)
  File "C:\Users\"User"\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\io\excel\_xlrd.py", line 20, in __init__
    import_optional_dependency("xlrd", extra=err_msg)
  File "C:\Users\"User"\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas\compat\_optional.py", line 90, in import_optional_dependency
    module = importlib.import_module(name)
  File "C:\Users\"User"\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import …
Run Code Online (Sandbox Code Playgroud)

xlrd python-3.x pandas

1
推荐指数
1
解决办法
2990
查看次数

标签 统计

pandas ×1

python-3.x ×1

xlrd ×1