5

I'm trying to install bigfloat and I am getting this message that seems to indicate I need the mpfr library first. How do I do this?
The message:

running build_ext building 'mpfr' extension creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c mpfr. c -o build/temp.linux-x86_64-2.7/mpfr.o mpfr.c:344:18: fatal error: mpfr.h: No such file or directory #include "mpfr.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

I'm pretty new to python and pythonanywhere, so I don't know how to install libraries.

I tried to find how to install a library using google, and I tried to use:

pip install --user mpfr 

but I get this error message:

Collecting mpfr Could not find a version that satisfies the requirement mpfr (from versions: ) No matching distribution found for mpfr

SherylHohman
  • 12,507
  • 16
  • 70
  • 78
vexgr1999
  • 51
  • 1
  • 4
  • What's the error message? What have you tried? – SherylHohman Sep 27 '17 at 00:06
  • 1
    The message:running build_ext building 'mpfr' extension creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c mpfr. c -o build/temp.linux-x86_64-2.7/mpfr.o mpfr.c:344:18: fatal error: mpfr.h: No such file or directory #include "mpfr.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 i'm pretty new to python and pythonanywhere so I don't know how to install libraries. – vexgr1999 Sep 27 '17 at 00:19
  • 1
    I tried to fin how to install a library using google, and I tried to use: pip install --user mpfr but I get this error message: Collecting mpfr Could not find a version that satisfies the requirement mpfr (from versions: ) No matching distribution found for mpfr – vexgr1999 Sep 27 '17 at 17:02

1 Answers1

16

The gmpy2 is written in C and depends on three other C libraries: GMP, MPFR, and MPC. The easiest way to ensure all the dependencies are present is to "libmpc-dev" using the standard package management tools from your Linux distribution. For example:

sudo apt-get install libmpc-dev 
Philippe Delteil
  • 598
  • 7
  • 25
casevh
  • 10,348
  • 1
  • 19
  • 30