Installing gmpy on OSX - mpc.h not found

Jakob Weisblat picture Jakob Weisblat · Apr 20, 2014 · Viewed 10.1k times · Source

I have brew installed mpcand gmp , but when I try to pip install gmpy2 I get a compile error on the line

#include "mpc.h"

so for some reason clang is having trouble finding the mpc library. I'm not sure what I should do at this point.

Answer

Werner Thie picture Werner Thie · Dec 27, 2014

For OSX with homebrew users - I tried to do the usual dance with

brew install mpc
brew install mpfr

and then

python setup.py --prefix=/usr/local/Cellar

but got the error, that 'mpc.h' could not be found. True enough, there is no mpc.h file to be found. The solution is, to use

brew install libmpc
brew install mpfr

instead. After that gmpy2 was compiling and installing with no further problems.