Binary package “python-gmpy” in ubuntu bionic

interfaces GMP to Python for fast, unbound-precision computations

 gmpy is a C-coded Python extension module that wraps the GMP library to
 provide to Python code fast multiprecision arithmetic (integer, rational, and
 float), random number generation, advanced number-theoretical functions, and
 more.