Installing gmpy on Mac OS X

About gmpy

gmpy is a Python extension module, which enables Python to use GMP. To install gmpy, pip is used. Searching for gmpy by pip, several kinds of gmpy are found. Their names and descriptions are shown below.


For the details of gmpy, please visit the URLs below.

URL1 this is what labs says>

URL2 This is New link for gmpy2>

According to the webpage of GMPY, GMPY and GMPY2 are Python expansion modules, which support the fast multiple precision arithmetic. GMPY only supports the GMP library and provides fast multiple-precision integer and rational arithmetic. The limited mpf type from GMP is also supported. GHGMPY is no longer being maintained. On the other hand, GMPY2 supports the GMP library for integer and rational arithmetic but GMPY2 adds support for multiple-precision real and complex arithmetic as provided by the MPFR and MPC libraries. GMPY2 is being actively developed.

Installing gmpy on Mac OS X

To install MPC on Mac OS X, please use pip. You have to install pip on Mac before working on gmpy2. In this article, MPFR and MPC are already installed on Mac. Thus, this article uses gmpy2 instead of gmpy. This article also uses Mac OS X Mavericks 10.9.3.

$ sudo pip install gmpy2

During the installation process, several warnings will appear. However, please ignore them. Regardless of these warnings, usually, the installation process will succeed.

To check whether gmpy2 is installed correctly or not, try execute a sample program. For instance, try execute gmpy2 and mpfr.


The details of this sample program are described at the page of <url>using gmp2 and mpfr</url>.

Revision History

Front page   New List of pages Search Recent changes   RSS of recent changes