python - ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
问题描述
In jupyter notebook I am running through this error. I am using py I just installed pytorch, previously it was working fine.
import pyodbc
import pandas as pd
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
When I run the above cell I got the following error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-1051f624fd0e> in <module>()
1 import pyodbc
----> 2 import pandas as pd
3 import matplotlib.pyplot as plt
4
5 import warnings
C:\Anaconda3\lib\site-packages\pandas\__init__.py in <module>()
29
30 try:
---> 31 from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
32 except ImportError as e: # pragma: no cover
33 # hack but overkill to use re
C:\Anaconda3\lib\site-packages\pandas\_libs\__init__.py in <module>()
1 # flake8: noqa
2
----> 3 from .tslibs import (
4 NaT,
5 NaTType,
C:\Anaconda3\lib\site-packages\pandas\_libs\tslibs\__init__.py in <module>()
1 # flake8: noqa
2
----> 3 from .conversion import localize_pydatetime, normalize_date
4 from .nattype import NaT, NaTType, iNaT, is_null_datetimelike
5 from .np_datetime import OutOfBoundsDatetime
__init__.pxd in init pandas._libs.tslibs.conversion()
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
解决方案
Which version of numpy
do you have installed? I got the same error with 1.18.5
, downgrading to 1.16.0
or 1.16.1
solved the issue.
Also check which numpy
version is required by pytorch
, and any other library requiring numpy
, I found pipdeptree
quite useful for that.
推荐阅读
- python - How to appending an element to column array in Panda Dataframe
- javascript - Matching post author to post in React from state
- python - remove array() from return
- reactjs - React/Axios - How to save current page so I can redirect after re-authentication
- c# - JSON 反序列化到现有库 C# 对象
- c# - 如何为导入的类实现接口
- r - 如何修复用户的 cronR 自动化错误?
- windows - IShellFolderView 的 RemoveObject 和 AddObject 方法的替代方案
- azure - 无法部署不存在的路径
- python - Heroku Django - 我需要为我在开发中所做的每一个更改运行 collectstatic