zoukankan      html  css  js  c++  java
  • import pandas出现‘ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject’问题

    一、问题描述:

         主要出现了‘ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject’问题。全部错误代码如下:

    >>> import pandas as pd
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "D:InstallSoftwareAnacondaenvsspyder_py3.5libsite-packagespandas\__init__.py", line 31, in <module>
        from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
      File "D:InstallSoftwareAnacondaenvsspyder_py3.5libsite-packagespandas\_libs\__init__.py", line 3, in <module>
        from .tslibs import (
      File "D:InstallSoftwareAnacondaenvsspyder_py3.5libsite-packagespandas\_libs	slibs\__init__.py", line 3, in <module>
        from .conversion import localize_pydatetime, normalize_date
      File "__init__.pxd", line 918, in init pandas._libs.tslibs.conversion
    ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
    

    二、问题分析:

         出现这种原因是numpy与pandas版本不匹配。

    三、问题解决:

         重新安装numpy,版本为1.14.5。最开始先卸载,结果出现了错误代码,索性就直接安装特定版本的啦~~

    pip install numpy==1.14.5
    pip install --upgrade numpy
    

         运行第二句命令时,虽然已经出现了问题,但我忽略了,并尝试导入两个包不再报错,也可以正常运行啦。

    出现问题时的运行截图:

    解决问题后的运行截图(可以顺利导入):

  • 相关阅读:
    AirtestIDE基本功能(二)
    AirtestIDE基本功能(一)
    Pycharm Debug功能详解
    AirtestIDE环境安装
    leetcode-338. 比特位计数
    leetcode-401. 二进制手表
    leetcode-392. 判断子序列
    leetcode-155. 最小栈
    leetcode-111. 二叉树的最小深度
    leetcode-110. 平衡二叉树
  • 原文地址:https://www.cnblogs.com/somedayLi/p/12403984.html
Copyright © 2011-2022 走看看