Skip to content

Instantly share code, notes, and snippets.

@mohammadnassiri
Last active November 27, 2020 03:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohammadnassiri/31ca8f4f2298d8694a8327814631455c to your computer and use it in GitHub Desktop.
Save mohammadnassiri/31ca8f4f2298d8694a8327814631455c to your computer and use it in GitHub Desktop.
numpy and its related packages (matplotlib, scipy, pandas, etc) installation problems in MacOS 11 (Big Sur)

If you have issues with installing numpy related packages on Big sur, these steps helped me: 1- Uninstall pyhon installed with homebrew and use python-installer. This resolves numpy issue. And it's better to install 1.18 or just anything bellow 1.19.

brew uninstall python

And install it from: https://www.python.org/downloads/
Then:

pip install numpy==1.18

numpy/numpy#15947 (comment)

2- For other packages like matplotlib, scipy and etc, delete command line tools and replace it with xcode.

sudo rm -r /Library/Developer/CommandLineTools
sudo xcode-select -s /Applications/Xcode.app

https://forums.swift.org/t/is-anyone-else-getting-this-error-when-building-the-compiler-from-master-on-macos/36113/2

For scipy I can't find anyway to solve the problems about accellorators and the resolve is to use wheels build for the previous MacOS versions.

pip install --platform macosx_10_9_x86_64 --only-binary=:all: --target=/usr/local/lib/python3.8/site-packages scipy

https://stackoverflow.com/questions/64847996/force-usage-of-10-x-wheel-in-macos-big-sur

Also this is an alternative way that I used to install gensim:

pip install smart-open
pip install six
pip install --platform macosx_10_9_x86_64 --only-binary=:all: --target=/usr/local/lib/python3.6/site-packages --no-deps gensim
pip install --platform macosx_10_9_x86_64 --only-binary=:all: --target=/usr/local/lib/python3.6/site-packages --no-deps scipy
pip install --platform macosx_10_9_x86_64 --only-binary=:all: --target=/usr/local/lib/python3.6/site-packages --no-deps numpy

As you saw it worked only with python3.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment