【问题标题】:Error in while compiling python code using sklearn.utils.shuffle使用 sklearn.utils.shuffle 编译 python 代码时出错
【发布时间】:2020-03-31 21:13:33
【问题描述】:

我正在使用 sklearn 并遇到了这个问题:

  File "C:\python\lib\sklearn\__init__.py", line 74, in <module>
    from .base import clone
  File "C:\python\lib\sklearn\base.py", line 20, in <module>
    from .utils import _IS_32BIT
  File "C:\python\lib\sklearn\utils\__init__.py", line 20, in <module>
    from .murmurhash import murmurhash3_32
  File "__init__.pxd", line 918, in init sklearn.utils.murmurhash
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

我该如何解决这个错误?

【问题讨论】:

  • 嗨!我看到你是一个新的贡献者。您的问题可以在某些情况下得到改进。你能解释一下你是怎么遇到这个问题的吗?谢谢!
  • @Auyer 正在编写脚本,但由于此错误而无法编译
  • 在 Python 中没有像 C/C++/Java 那样的编译,你运行代码。
  • 可能您必须更新sklearn 或numpy(或其他模块),因为存在一些不兼容问题。
  • @furas 我最近安装了两个 sklearn n numpy 库,所以它们都是最新版本

标签: python python-3.x numpy scikit-learn


【解决方案1】:

所以我得到了解决方案,我确实通过使用更新了 numpy 库 pip install numpy --upgrade ,这更新了 numpy,但是当我进入 python 时它指向旧版本,所以我只需从中删除以前的 numpy 库 python/lib & python/lib/站点包 然后重新安装。现在它正在工作!

【讨论】:

    猜你喜欢
    • 2021-08-15
    • 2014-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-22
    • 1970-01-01
    相关资源
    最近更新 更多