Python3.9 malloc:无法分配区域错误3

Ray*_*_90 7 python macos numpy python-3.x pandas

我正在使用 Python3.9 并且我开始编写一个简单的脚本来塑造一些数据,我只写了一行就测试了它,我收到了这个错误:

 $ Python3.9 Shape_Response.py 
Python(2857,0x1061635c0) malloc: can't allocate region
*** mach_vm_map(size=18446744072478715904) failed (error code=3)
Python(2857,0x1061635c0) malloc: *** set a breakpoint in malloc_error_break to debug
init_dgelsd failed init
Traceback (most recent call last):
  File "/Users/dominik/Desktop/Google Analytics API/Shape_Response.py", line 1, in <module>
    import pandas as pd, numpy as np
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/__init__.py", line 11, in <module>
    __import__(dependency)
  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
Run Code Online (Sandbox Code Playgroud)

这是 Python 脚本:

 $ Python3.9 Shape_Response.py 
Python(2857,0x1061635c0) malloc: can't allocate region
*** mach_vm_map(size=18446744072478715904) failed (error code=3)
Python(2857,0x1061635c0) malloc: *** set a breakpoint in malloc_error_break to debug
init_dgelsd failed init
Traceback (most recent call last):
  File "/Users/dominik/Desktop/Google Analytics API/Shape_Response.py", line 1, in <module>
    import pandas as pd, numpy as np
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/__init__.py", line 11, in <module>
    __import__(dependency)
  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
Run Code Online (Sandbox Code Playgroud)

我正在阅读的文件是:

Hello
Hello
Hello
Run Code Online (Sandbox Code Playgroud)

我在 MacO 上。

我的 Python 安装的详细信息是:

import pandas as pd, numpy as np

df = pd.read_csv('test.txt', delimiter = "\n", header=None)

print(df)
Run Code Online (Sandbox Code Playgroud)

我使用pip install wheel和安装了熊猫pip install pandas

我也有空闲内存,我重新安装了 Python,但仍然遇到此错误。

我是 Python 初学者,我真的不明白错误信息,我尝试搜索但没有任何效果......

关于我做错了什么的任何想法?

非常感谢

小智 2

当我使用brew安装python3.8/3.9时,我也遇到了同样的问题。我通过删除 python 的brew版本并从python.org/mac-osx安装 python 解决了这个问题