繁体   English   中英

由于 polyfit 错误,macOS Big Sur python3 无法导入 numpy

[英]macOS Big Sur python3 cannot import numpy due to polyfit error

2021 年 1 月的更新:我在2021 年 1 月执行了 Big Sur 的python3 -m pip install --upgrade pip --user ,并使用python3 -m pip install --upgrade pip --user将 pip 升级到最新版本,并且安装numpy没有问题,并且没有下面的错误消息。

2020 年 11 月的原始问题

我在 2019 macbook pro 上使用 macOS big sur。 我可以使用python3 -m pip install numpy --user 注意我没有brew; 我只是使用 Xcode 命令行工具中的 python3。 我在许多其他地方看到过这个错误报告,但他们似乎都使用 brew。

但是,当我尝试import numpy as np ,我收到以下错误消息。

Python(488,0x11700be00) malloc: can't allocate region
:*** mach_vm_map(size=18446744071565352960, flags: 100) failed (error code=3)
Python(488,0x11700be00) malloc: *** set a breakpoint in malloc_error_break to debug
init_dgelsd failed init
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xdavidliu/Library/Python/3.8/lib/python/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

我的问题中默认安装的 numpy(并导致崩溃)是 1.19。 我能够通过以下解决方法使用 numpy:

python3 -m pip uninstall numpy
python3 -m pip install numpy==1.18.0 --user

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM