首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >numpy.ufunc的大小错误,请尝试重新编译。我使用OpenBSD6.4下的python3.6,但是导入pandas失败

numpy.ufunc的大小错误,请尝试重新编译。我使用OpenBSD6.4下的python3.6,但是导入pandas失败
EN

Stack Overflow用户
提问于 2019-01-06 22:01:43
回答 1查看 1.4K关注 0票数 1

我在OpenBSDd6.4下安装了python3.6用于数据分析(这是个好主意吗?)因为Anaconda不能在OpenBSD下工作,所以我安装pip来管理python包。我使用pkg_add -v python安装python3.6.6

代码语言:javascript
复制
pip install pandas

上面的代码为我带来了最新的pandas版本0.23.4和numpy 1.15.4。当我使用import pandas时,会出现错误的消息。

代码语言:javascript
复制
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的位置和版本,

代码语言:javascript
复制
>>> import numpy
>>> numpy.__file__
'/usr/local/lib/python3.6/site-packages/numpy/__init__.py'

>>> numpy.version.version
'1.15.4'

我在谷歌上搜索一些决议,比如,

代码语言:javascript
复制
pip uninstall pandas
pip uninstall numpy
pip install pandas -U

但是失败了。

代码语言:javascript
复制
pip install --upgrade --force-reinstall pandas

上述命令失败。

代码语言:javascript
复制
https://stackoverflow.com/questions/53904157/numpy-ufunc-has-the-wrong-size-try-recompiling-even-with-the-latest-pandas-and

上面的url失败。

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

EN

回答 1

Stack Overflow用户

发布于 2019-10-23 21:44:53

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

pip3.4安装numpy==1.16.5

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54062244

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档