[英]incompatible packages when trying to run tensorflow example code
I'm trying to run some example code found on keras .我正在尝试运行在keras上找到的一些示例代码。 When I run
import tensorflow
, I get an error当我运行
import tensorflow
时,出现错误
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Then when I import pandas
, I get the error然后当我
import pandas
时,我得到了错误
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
According to this post , there is some incompatibility between the pandas, numpy, and tensorflow packages.根据这篇文章,pandas、numpy 和 tensorflow 封装之间存在一些不兼容。 I tried some of the suggestions in that post like installing specific versions of pandas and numpy, but I still get errors.
我尝试了该帖子中的一些建议,例如安装特定版本的 pandas 和 numpy,但我仍然遇到错误。 (I'm using WinPython 64 bit v.3.9.4.0) Any suggestions?
(我使用的是 WinPython 64 位 v.3.9.4.0)有什么建议吗?
Note: I have packages numpy 1.19.5
, pandas 1.2.4
, tensorflow 2.5.0
.注意:我有包
numpy 1.19.5
, pandas 1.2.4
, tensorflow 2.5.0
。
When you install a package, the dependencies are automatically installed with the good version.当您安装 package 时,会自动安装好版本的依赖项。 I recommend you to uninstall all of these libraries and then run
pip install tensorflow
.我建议您卸载所有这些库,然后运行
pip install tensorflow
。 It will install the correct version of numpy.它将安装正确版本的 numpy。 Then install the latest version of pandas with
pip install pandas
.然后安装最新版本的 pandas 和
pip install pandas
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.