2

I'm trying to get the bigfloat Python package onto my mac, but I'm not very good at this sort of thing.

I have downloaded the latest package as described here. The documentation says:

In order to use the bigfloat package you will need to have both the GMP and MPFR libraries already installed on your system.

I think that the GMP and MPFR libraries are already installed on my system - at least when I search for them I see folders with their names and files in them.

When I try to install bigfloat by typing:

python setup.py install

I get lots of error messages. The first ones being:

src/mpfr.c:223:17: error: gmp.h: No such file or directory
src/mpfr.c:224:18: error: mpfr.h: No such file or directory

The gmp.h and mpfr.h files are on my computer, but obviously I need to do something else.

Cleary I don't understand how the whole process works, but any pointers in the right direction would be great. Thank you.

unutbu
  • 842,883
  • 184
  • 1,785
  • 1,677
user1551817
  • 6,693
  • 22
  • 72
  • 109

3 Answers3

1

First you will need to have installed both the GMP and MPFR libraries.

sudo apt-get install libmpfr-dev

Then just run:

 sudo pip install bigfloat

Regards!

Charles P.
  • 1,947
  • 16
  • 13
0

I'm having the same problem and here's what I've tried as per the readme file in the bigfloat installation directory:

"An example: on Mac OS X, using the system Python, but with MPFR and GMP installed in /opt/local (e.g., by MacPorts), one can do":

LIBRARY_PATH=/opt/local/lib CPATH=/opt/local/include python setup.py build

This didn't throw any errors, but when I checked to see if it installed by running this test:

python -m bigfloat.test.test_bigfloat

I got the error:

/Library/Frameworks/Python.framework/Versions/7.2/Resources/Python.app/Contents/MacOS/Python: No module named mpfr  

You can give this a try to see if it works for you, but I'm still lost.

What you should get if it's a successful installation is this:

the bigfloat-0.3.0a1/ directory that you created can now be deleted.
astromax
  • 6,001
  • 10
  • 36
  • 47
  • I got bigfloat to install, but only when I decided to change my python installation (went with anaconda python: http://www.continuum.io/downloads). I did so by doing "pip install bigfloat". This is no solution, but I just wanted to inform you of the pip install option. – astromax Jul 14 '13 at 20:19
0

I was having trouble installing python bigfloat on my Mac (v10.10.3) via easy_install and pip and got a similar error problem; it is because bigfloat requires a couple other libraries.

Per this answer

I installed the gmp & mpfr libraries then pip would install properly

pip install bigfloat

or

pip3.5 install bigfloat
Community
  • 1
  • 1
B Rad C
  • 510
  • 2
  • 6
  • 18