6

Since I've upgraded my MacOs to Big Sur I'm having some trouble with my data science libraries. I was able to install the numpy and pandas (even though it took an unusual amount of time as stated at this topic). But can't manage to install the Matplotlib.

I've tried three things... First with the default MacOs embedded Phyton 3.8.2 . Reinstalled numpy, upgraded pip, but when I've tried to install Matplotlib. I've got the following error:

    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

Later, I've seen some suggestions here at stackoverflow for similar problems, one suggested to use homebrew, so I've installed Python 3.9.0 through brew. However, when I've tried to install Matplotlib, still got a giant error, when it was trying to install Pillow:

(.......) The headers or library files could not be found for jpeg,a required dependency when compiling 
Pillow from source.Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
ERROR: Command errored out with exit status 1: /usr/local/opt/[email protected]/bin/python3.9 (...)

To finish (in almost despair) I've tried to create a virtual environment using venv (& Python 3.8.2) and was able to install NumPy successfully, however, I've got the following error trying to install Matplotlib:

(...... long line of code....) The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

Really don't know what to do... Is it impossible to use Matplotlib with a clean install on BigSur? hahaha =(

2 Answers 2

5

I did it!!! I fix it!!

For this error :

  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

I fixed installing an older numpy version.

pip3 install --force-reinstall numpy\<1.19

It did the job.

For the second error:

(.......) The headers or library files could not be found for jpeg,a required dependency when compiling 
Pillow from source.Please see the install instructions at: https://pillow.readthedocs.io/en/latest/installation.html
ERROR: Command errored out with exit status 1: /usr/local/opt/[email protected]/bin/python3.9 (...)

It was the missing JPEG library. I do recommend you guys install homebrew. Solved this problem with:

brew install libjpeg
2
  • brew install libjpeg saved me a ton of time, thank you :)
    – van
    Commented Nov 26, 2020 at 0:29
  • same for me :) thanks for pointing it out Commented Nov 27, 2020 at 17:01
1

your easy_install is outdated.so just update your setup_tools by excuting following command:

pip install setuptools==51

then

easy_install --version

make sure your easy_install's version is above 51.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.