You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

pandas读取Excel时报tensorflow_core.estimator模块缺失如何解决

解决方案
  • 首先排查执行的代码是否正确:你当前的报错是tensorflow相关依赖缺失,和pandas读取Excel的逻辑没有直接关联,优先确认你运行的脚本是否只有你贴出的3行代码,有没有可能误运行了其他导入tensorflow的脚本。可以新建空白脚本仅写入导入pandas、读取Excel的代码单独测试,排除代码本身的问题。
  • 修复环境中tensorflow的依赖问题:你当前使用的是名为Seq2Seq1的conda环境,该环境内的tensorflow版本适配异常导致estimator包缺失,不要单独降级estimator版本,直接整体重装tensorflow即可:
    1. 激活对应conda环境:
    conda activate Seq2Seq1
    
    1. 卸载现有残缺的tensorflow相关包:
    pip uninstall -y tensorflow tensorflow-estimator tensorflow-core
    
    1. 重装匹配版本的tensorflow:如果你的项目依赖TensorFlow 1.x版本,执行
    pip install tensorflow==1.15 tensorflow-estimator==1.15.1
    
    如果依赖TensorFlow 2.x版本,执行
    pip install tensorflow
    
  • 补充pandas读取Excel的必要依赖:pd.read_excel读取xlsx格式文件需要依赖openpyxl引擎,提前安装避免后续读文件报错:
    pip install openpyxl
    
    读取文件时可以显式指定引擎,兼容性更好:
    # importing the data of subject 1 
    import pandas as pd
    df = pd.read_excel(r'C:\Users\henda\OneDrive\Desktop\Collection\Research\Germany\2D Data\Subject 1 (Jan lau)\Train.xlsx', engine='openpyxl')   
    # print (df)
    

内容的提问来源于stack exchange,提问作者HendElMohandes

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.07 06:09:03