【问题标题】:numpy.ufunc has the wrong size, try recompiling.I use python3.6 under OpenBSD6.4,however,import pandas failednumpy.ufunc大小不对,重新编译试试。我在OpenBSD6.4下使用python3.6,但是,import pandas失败
【发布时间】:2019-10-23 21:44:52
【问题描述】:

我在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

以上网址失败。

你介意给我一个关于如何解决这个问题的提示吗? 使用 OpenBSD 作为数据分析平台是不是一个不错的选择? 谢谢。

【问题讨论】:

  • 强制重新安装 Pandas 时收到什么失败消息?卸载后可能需要从库中删除文件
  • 感谢您的评论。 pip install --upgrade --force-reinstall pandas 成功,但是不能解决这个问题。import pandas 时出现同样的错误。当我卸载 pandas 和 numpy 时,命令 pip uninstall pandas 和 pip uninstall numpy 显示从它们的目录中删除了两个包,我可以确认。
  • import pandas 给你同样的错误?
  • 是的,同样的错误。
  • 你很可能错过了旧版本的 numpy

标签: python pandas openbsd


【解决方案1】:

我在使用 numpy 1.14.5 时遇到了同样的问题,我通过安装 numpy 1.16.5 解决了这个问题

pip3.4 安装 numpy==1.16.5

【讨论】:

    猜你喜欢
    • 2019-05-23
    • 1970-01-01
    • 2014-11-21
    • 2018-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-16
    相关资源
    最近更新 更多