gpt4 book ai didi

Python3.9 malloc : can't allocate region error 3

转载 作者:行者123 更新时间:2023-12-03 13:59:08 24 4
gpt4 key购买 nike

我正在使用 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
这是 Python 脚本:
import pandas as pd, numpy as np

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

print(df)
我正在阅读的文件是:
Hello
Hello
Hello
我在 MacO 上。
我的 Python 安装的详细信息是:
dominik at Dominiks-MacBook-Pro in Google Analytics API
$ which python
/usr/bin/python

dominik at Dominiks-MacBook-Pro in Google Analytics API
$ python --version
>>> Python 3.9.0

dominik at Dominiks-MacBook-Pro in Google Analytics API
$ pip --version
>>> pip 20.2.4 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)

dominik at Dominiks-MacBook-Pro in Google Analytics API
$ pip list
>>> Package Version
>>> --------------- -------
>>> numpy 1.19.2
>>> pandas 1.1.3
>>> pip 20.2.4
>>> python-dateutil 2.8.1
>>> pytz 2020.1
>>> setuptools 49.2.1
>>> six 1.15.0
>>> wheel 0.35.1
我使用 pip install wheelpip install pandas 安装了 Pandas 。
我也有空闲内存,我重新安装了 Python,但仍然遇到此错误。
我是 Python 初学者,我真的不明白错误信息,我尝试搜索但没有任何效果......
关于我做错了什么的任何想法?
非常感谢你

最佳答案

截至目前,brew 在 MacOS BIG SUR 上还不稳定。
我升级到 Python 3.9 并在 numpy mem 分配方面遇到了同样的问题,所以我像这样回滚了:

brew link --overwrite python@3.8
Linking /usr/local/Cellar/python@3.8/3.8.6_2... 25 symlinks created

If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
这样我就回到了 Python 3.8.6,它工作正常

关于Python3.9 malloc : can't allocate region error 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64530174/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com