Python &引用;初始化“dgelsd失败初始化”;当使用import numpy作为np时

Python &引用;初始化“dgelsd失败初始化”;当使用import numpy作为np时,python,numpy,Python,Numpy,我正在尝试运行这个简单的代码 import numpy as np my_first_array = np.array([1, 2, 3,4,5]) my_first_array([1, 2, 3, 4, 5]) 我相信我正在使用Python3.9,因为我刚买了这台电脑并下载了最新版本。 但请继续获取错误代码: Traceback (most recent call last): File "/Users/oledy/Documents/Skole/Dat200/test.p

我正在尝试运行这个简单的代码

import numpy as np

my_first_array = np.array([1, 2, 3,4,5])

my_first_array([1, 2, 3, 4, 5])
我相信我正在使用Python3.9,因为我刚买了这台电脑并下载了最新版本。 但请继续获取错误代码:

Traceback (most recent call last):
  File "/Users/oledy/Documents/Skole/Dat200/test.py", 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
回溯(最近一次呼叫最后一次):
文件“/Users/oledy/Documents/Skole/Dat200/test.py”,第1行,在
将numpy作为np导入
文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site packages/numpy/__init__.py”,第286行,在
引发运行时错误(msg)
运行时错误:Polyfit健全性测试发出警告,很可能是由于使用了错误的加速后端。如果您自己编译,请参阅site.cfg.example以了解信息。否则,请向提供NumPy的供应商报告。
兰克瓦宁:Polyfit可能条件较差

如果你想了解一下这个问题,我在这里找到了下面的答案

rm -v ~/Library/Caches/pip/wheels/*/*/*/*/*numpy* # clear the pip wheel cache of any built numpy wheels
brew install openblas # make sure OpenBLAS is installed
# activate your virtualenv
OPENBLAS="$(brew --prefix openblas)" pip install numpy # let numpy's setup.py know where OpenBLAS is installed