我正在使用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
我正在使用MacOS。
我的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 wheel
和 pip install pandas
安装了 pandas。
我还有足够的内存,重新安装了 Python,但仍然遇到这个错误。
我是 Python 初学者,真的不理解这个错误信息,我尝试过搜索,但没什么效果...
您有什么想法,我做错了什么吗?
非常感谢!