How to solve "Preparing wheel metadata ... error" this error for MacOS for python 3.9

32.9k views Asked by At

I am trying to use pip3 with python 3.9 to install modules... I read replies for windows which suggest installing VisualStudio as we need a good C++ compiler

I use macOS

I am adding the input and error message for better understanding

Input:

rohansaswade@Rohans-MBP ~ % pip3 install numpy

Output:

 Collecting numpy
  Using cached numpy-1.19.2.zip (7.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:

I did not mention the complete error output as it seems pretty irrelevant, yet if you need it to help me, please drop a comment.

I use macOS Catalina 10.15.7 and python 3.9

2

There are 2 answers

0
Shintaro On BEST ANSWER

I had the same issue. In my case, the steps below helped though it was time-consuming.

#Preparation
pip install cython
git clone https://github.com/numpy/numpy.git

#Steps
cd numpy
python setup.py build
python setup.py install

I hope it works for you too.

0
Valentin B On

I had the same issue, what worked for me is to

#Upgrade pip

pip3 install --upgrade pip