首页 > 解决方案 > 在简单的python脚本中导入熊猫后出错

问题描述

所以基本上我只是创建了一个 virtualenv 并在运行pip install pandas并尝试运行我的脚本后,这个错误会跳出来:

在此处输入图像描述

我不明白,当我导入 pandas 时,错误出现在 grist 行中。如果我只是删除此行...脚本照常工作

我能做些什么 ???请帮助!

这些是我的版本: 在此处输入图像描述

更新:

文本错误:

Python(25555,0x110fc3dc0) malloc: can't allocate region
:*** mach_vm_map(size=18446744071807086592, flags: 100) failed (error code=3)
Python(25555,0x110fc3dc0) malloc: *** set a breakpoint in malloc_error_break to debug
init_dgelsd failed init
Traceback (most recent call last):
  File "/Users/deivbid/Documents/David/Python/Scrapper/main.py", line 1, in <module>
    import pandas as pd
  File "/Users/deivbid/Documents/David/Python/Scrapper/env/lib/python3.9/site-packages/pandas/__init__.py", line 11, in <module>
    __import__(dependency)
  File "/Users/deivbid/Documents/David/Python/Scrapper/env/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 版本:3.9.0 点子版本:20.2.3

标签: pythonpandasmalloc

解决方案


得到了同样的错误,发现了这个:https ://github.com/numpy/numpy/issues/15947

对我来说 pip3 install numpy==1.18.0 解决了这个问题


推荐阅读