树莓派Zero导入pandas遇numpy二进制兼容错误求助
树莓派Zero导入Pandas报错求助
树莓派Zero此前正常使用数月,闲置数月后开机无法导入pandas,报错信息如下:
Python 3.7.3 (default, Oct 31 2022, 14:04:00) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy as np >>> import pandas as pd Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/pi/.local/lib/python3.7/site-packages/pandas/__init__.py", line 22, in <module> from pandas.compat import ( File "/home/pi/.local/lib/python3.7/site-packages/pandas/compat/__init__.py", line 15, in <module> from pandas.compat.numpy import ( File "/home/pi/.local/lib/python3.7/site-packages/pandas/compat/numpy/__init__.py", line 7, in <module> from pandas.util.version import Version File "/home/pi/.local/lib/python3.7/site-packages/pandas/util/__init__.py", line 1, in <module> from pandas.util._decorators import ( # noqa File "/home/pi/.local/lib/python3.7/site-packages/pandas/util/_decorators.py", line 14, in <module> from pandas._libs.properties import cache_readonly # noqa File "/home/pi/.local/lib/python3.7/site-packages/pandas/_libs/__init__.py", line 13, in <module> from pandas._libs.interval import Interval File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 44 from C header, got 40 from PyObject
已尝试以下操作但问题未解决:
- 执行
sudo apt update更新系统 - 卸载重装numpy和pandas,命令如下:
sudo apt remove python3-numpy python3-pandas sudo apt-get install python3-numpy python3-pandas python3-scipy python3-sklearn python3-numexpr
当前相关包版本信息:
python3-numpy/oldstable,now 1:1.16.2-1 armhf [installed] python3-pandas-lib/oldstable,now 0.23.3+dfsg-3 armhf [installed,automatic] python3-pandas/oldstable,now 0.23.3+dfsg-3 all [installed]
系统信息:
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
恳请提供解决思路。
内容的提问来源于stack exchange,提问作者Bill
相关产品推荐
相关产品推荐

