Pandas: BUG: Python 3.9 Polyfit sanity test emitted a warning

Created on 11 Oct 2020  路  12Comments  路  Source: pandas-dev/pandas

  • [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pandas.

  • [ ] (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.

Code Sample, a copy-pastable example

import pandas as pd

Problem description

When importing pandas using python 3.9.0 I get the following error:

python(81328,0x10d755dc0) malloc: can't allocate region
:*** mach_vm_map(size=18446744071827312640, flags: 100) failed (error code=3)
python(81328,0x10d755dc0) malloc: *** set a breakpoint in malloc_error_break to debug
init_dgelsd failed init
Traceback (most recent call last):
  File "/Users/paul/python/test/t.py", line 2, in <module>
    import pandas as pd
  File "/Users/paul/python/test/venv/lib/python3.9/site-packages/pandas/__init__.py", line 11, in <module>
    __import__(dependency)
  File "/Users/paul/python/test/venv/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

Expected Output

Pandas should import without an error.

Output of pd.show_versions()

I am unable to run pd.show_versions() because the program crashes as soon as pandas is imported. I am installing pandas 1.1.3 on a Mac.

Bug Needs Triage

Most helpful comment

This one worked for me:

$ pip cache remove numpy
$ brew install openblas # make sure OpenBLAS is installed
$ OPENBLAS="$(brew --prefix openblas)" pip install numpy # let numpy's setup.py know where OpenBLAS is installed

All 12 comments

and how exactly did you install 3.9?

as there are no wheels or package or even numpy wheels or
packages yet

And the RuntimeError is coming from NumPy, when we import it. So this is likely an issue with how you installed NumPy.

I installed 3.9 with pyenv. Then pip install pandas to install pandas (I didn't do a separate install of NumPy).

See https://github.com/numpy/numpy/issues/15947 for this issue in numpy (and some potential workarounds).

None of those workarounds work for me even in a clean virtual environment (3.9) and an empty pip cache

pip install matplotlib

always fails with

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

This one worked for me:

$ pip cache remove numpy
$ brew install openblas # make sure OpenBLAS is installed
$ OPENBLAS="$(brew --prefix openblas)" pip install numpy # let numpy's setup.py know where OpenBLAS is installed

@matthiasdiener Does that work on 3.9?

@matthiasdiener Does that work on 3.9?

yes

@matthiasdiener Just

$ pip cache remove numpy
$ brew install openblas 
$ OPENBLAS="$(brew --prefix openblas)" pip install numpy

does indeed work; but subsequent

pip install matplotlib

results in pages and pages or errors ending in

ERROR: Failed building wheel for matplotlib

followed by an attempt to build matplotlib, which ends in more pages of errors and

ERROR: Command errored out with exit status 1: /Users/Rax/Documents/Projects/Coding/Python/venvs/dataviz/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/pip-install-e0fr6lw0/matplotlib/setup.py'"'"'; __file__='"'"'/private/var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/pip-install-e0fr6lw0/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/b6/3rk65h797p7407x7d36sqn9c0000gn/T/pip-record-p4qzyrcr/install-record.txt --single-version-externally-managed --compile --install-headers /Users/Rax/Documents/Projects/Coding/Python/venvs/dataviz/include/site/python3.9/matplotlib Check the logs for full command output.

What am I doing wrong?

Is there a place to register to be notified when NumPy works with Python 3.9?

numpy 1.19.3 has 3.9 wheels up on pypi now

Now that numpy has the wheel I am able to install with no issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mfmain picture mfmain  路  3Comments

nathanielatom picture nathanielatom  路  3Comments

matthiasroder picture matthiasroder  路  3Comments

amelio-vazquez-reina picture amelio-vazquez-reina  路  3Comments

swails picture swails  路  3Comments