ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 48 from C head

问题描述:运行python脚本时出现以上问题

网上查到的解决方法:通过pip install -U numpy升级版本

由于运行的其他库存在版本依赖,不能通过升级numpy版本来解决此问题。

根据上行文是scipy库导入numpy时导致的问题,根据numpy的安装版本1.20.3,选择安装早于此版本发布的scipy版本1.6.3更新后,解决了此问题。

在numpy的官网和scipy的官网查到版本发布信息如下:

NumPy 1.21.6 (release notes) – 12 Apr 2022.
NumPy 1.22.3 (release notes) – 7 Mar 2022.
NumPy 1.22.2 (release notes) – 3 Feb 2022.
NumPy 1.22.1 (release notes) – 14 Jan 2022.
NumPy 1.22.0 (release notes) – 31 Dec 2021.
NumPy 1.21.5 (release notes) – 19 Dec 2021.
NumPy 1.21.0 (release notes) – 22 Jun 2021.
NumPy 1.20.3 (release notes) – 10 May 2021.
NumPy 1.20.0 (release notes) – 30 Jan 2021.
NumPy 1.19.5 (release notes) – 5 Jan 2021.
NumPy 1.19.0 (release notes) – 20 Jun 2020.
NumPy 1.18.4 (release notes) – 3 May 2020.
NumPy 1.17.5 (release notes) – 1 Jan 2020.
NumPy 1.18.0 (release notes) – 22 Dec 2019.
NumPy 1.17.0 (release notes) – 26 Jul 2019.
NumPy 1.16.0 (release notes) – 14 Jan 2019.
NumPy 1.15.0 (release notes) – 23 Jul 2018.
NumPy 1.14.0 (release notes) – 7 Jan 2018.


SciPy 1.8.0 (release notes) – 2022-02-05.
SciPy 1.7.3 (release notes) – 2021-11-24.
SciPy 1.7.2 (release notes) – 2021-11-05.
SciPy 1.7.1 (release notes) – 2021-08-01.
SciPy 1.7.0 (release notes) – 2021-06-20.
SciPy 1.6.3 (release notes) – 2021-04-25.
SciPy 1.6.2 (release notes) – 2021-03-24.
SciPy 1.6.1 (release notes) – 2021-02-17.
SciPy 1.6.0 (release notes) – 2020-12-31.
SciPy 1.5.0 (release notes) – 2020-06-21.
SciPy 1.5.4 (release notes) – 2020-11-04.
SciPy 1.5.3 (release notes) – 2020-10-17.
SciPy 1.5.2 (release notes) – 2020-07-23.
SciPy 1.5.1 (release notes) – 2020-07-04.
SciPy 1.2.3 (release notes) – 2020-01-21.
SciPy 1.4.1 (release notes) – 2019-12-19.
SciPy 1.4.0 (release notes) – 2019-12-16.
SciPy 1.3.2 (release notes) – 2019-11-09.
SciPy 1.3.1 (release notes) – 2019-08-08.
SciPy 1.3.0 (release notes) – 2019-05-17.
SciPy 1.2.2 (release notes) – 2019-06-06.
SciPy 1.2.1 (release notes) – 2019-02-08.
SciPy 1.2.0 (release notes) – 2018-12-17.
SciPy 0.19.1 (release notes) – 2017-06-21.
SciPy 0.19.0 (release notes) – 2017-03-09.
SciPy 1.1.0 (release notes) – 2018-05-05.
SciPy 1.0.0 (release notes) – 2017-10-25.
SciPy 0.18.1 (release notes) – 2016-09-19.
SciPy 0.18.0 (release notes) – 2016-07-25.
SciPy 0.17.1 (release notes) – 2016-05-12.
SciPy 0.17.0 (release notes) – 2016-01-23.
SciPy 0.16.1 (release notes) – 2015-10-24.
SciPy 0.16.0 (release notes) – 2015-07-23.
SciPy 0.15.1 (release notes) – 2015-01-18.
SciPy 0.15.0 (release notes) – 2015-01-11.
SciPy 0.14.1 (release notes) – 2014-12-30.
SciPy 0.14.0 (release notes) – 2014-05-03.
SciPy 0.13.3 (release notes) – 2014-02-04.
SciPy 0.13.2 (release notes) – 2013-12-08.
SciPy 0.12.0 (release notes) – 2013-04-07.
SciPy 0.11.0 (release notes)– 2012-09-25.

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值