Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install GNU MPFR library on pythonanywhere

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

like image 581
vexgr1999 Avatar asked Sep 26 '17 23:09

vexgr1999


1 Answers

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 
like image 93
casevh Avatar answered Sep 30 '22 15:09

casevh