【问题标题】:incompatible packages when trying to run tensorflow example code尝试运行 tensorflow 示例代码时不兼容的包
【发布时间】:2021-08-06 07:44:41
【问题描述】:

我正在尝试运行在keras 上找到的一些示例代码。当我运行import tensorflow 时,出现错误

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

然后当我import pandas 时,我得到了错误

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

根据this post,pandas、numpy 和 tensorflow 包之间存在一些不兼容问题。我尝试了该帖子中的一些建议,例如安装特定版本的 pandas 和 numpy,但我仍然遇到错误。 (我使用的是 WinPython 64 位 v.3.9.4.0)有什么建议吗?

注意:我有包numpy 1.19.5pandas 1.2.4tensorflow 2.5.0

【问题讨论】:

  • 你的 pandas 和 numpy 版本是什么?

标签: python pandas numpy tensorflow machine-learning


【解决方案1】:

安装包时,依赖项会自动安装好版本。我建议您卸载所有这些库,然后运行pip install tensorflow。它将安装正确版本的 numpy。然后用pip install pandas安装最新版的pandas。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-10-16
    • 2020-07-03
    • 2018-09-21
    • 1970-01-01
    • 1970-01-01
    • 2020-04-15
    • 1970-01-01
    • 2017-05-27
    相关资源
    最近更新 更多