我在OpenBSDd6.4下安装了python3.6用于数据分析(这是个好主意吗?)因为Anaconda不能在OpenBSD下工作,所以我安装pip来管理python包。我使用pkg_add -v python安装python3.6.6
pip install pandas上面的代码为我带来了最新的pandas版本0.23.4和numpy 1.15.4。当我使用import pandas时,会出现错误的消息。
Python 3.6.6 (default, Oct 11 2018, 16:49:21)
[GCC 4.2.1 Compatible OpenBSD Clang 6.0.0 (tags/RELEASE_600/final)] on openbsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/pandas/__init__.py", line 26, in <module>
from pandas._libs import (hashtable as _hashtable,
File "/usr/local/lib/python3.6/site-packages/pandas/_libs/__init__.py", line 4, in <module>
from .tslib import iNaT, NaT, Timestamp, Timedelta, OutOfBoundsDatetime
File "__init__.pxd", line 872, in init pandas._libs.tslib
ValueError: numpy.ufunc has the wrong size, try recompiling. Expected 112, got 124
>>> 我用命令检查numpy的位置和版本,
>>> import numpy
>>> numpy.__file__
'/usr/local/lib/python3.6/site-packages/numpy/__init__.py'
>>> numpy.version.version
'1.15.4'我在谷歌上搜索一些决议,比如,
pip uninstall pandas
pip uninstall numpy
pip install pandas -U但是失败了。
pip install --upgrade --force-reinstall pandas上述命令失败。
https://stackoverflow.com/questions/53904157/numpy-ufunc-has-the-wrong-size-try-recompiling-even-with-the-latest-pandas-and上面的url失败。
你介意给我一个关于如何解决这个问题的提示吗?使用OpenBSD作为数据分析平台是一个好的选择吗?谢谢。
发布于 2019-10-23 21:44:53
我在numpy 1.14.5上遇到了同样的问题,我通过安装numpy 1.16.5解决了这个问题
pip3.4安装numpy==1.16.5
https://stackoverflow.com/questions/54062244
复制相似问题