How to install GNU MPFR library on pythonanywhere
Asked Answered
A

1

9

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

Abmho answered 26/9, 2017 at 23:58 Comment(3)
What's the error message? What have you tried?Legionnaire
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.Abmho
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 mpfrAbmho
D
21

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 
Dagger answered 29/10, 2017 at 6:3 Comment(1)
For CentOS Use : yum install libmpc-develWillett

© 2022 - 2024 — McMap. All rights reserved.