首页 > 解决方案 > 如何解决这个涉及 Polyfit 的 NumPy 错误?

问题描述

我最近将我的 Python 版本从 3.8.5 升级到了 3.9.0,我很失望地看到我不得不重新安装我的所有模块。我在终端中使用了这一行来安装它:

pip3 install --upgrade numpy

它似乎工作正常,没有警告或任何东西。但是,当我实际尝试导入它时,我收到此错误:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import numpy as np
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module>
    raise RuntimeError(msg)
RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.
RankWarning: Polyfit may be poorly conditioned

我不是在编译自己;我使用 pip 安装了它。这在使用 3.8.5 时从未发生过。如果有帮助,我正在使用 Mac。我该如何解决这个错误?

标签: pythonpython-3.xnumpy

解决方案


看起来我已经解决了这个问题,1,通过 pvenv 安装一个新环境。(之前我用的是virtualenv) 2、安装python 3.7.1(之前我用的是3.9)


推荐阅读