Troubleshooting problems with Installing the Python module gmpy2

Source: Internet
Author: User

The next act is to install the Python module gmpy2

This module is used for high-precision calculation of the module, the individual according to the requirements, I often used to do RSA encryption algorithm calculation

As a shallow Ubuntu player, this knowledge is of course online search, but most of the information on the Internet is not complete, the whole others according to their tutorial did a morning or not successfully installed. And mine is summed up on the shoulders of these big guys.

In Python, the default is no GMPY2 module, so most people directly to pip install Gmpy2 module installation, brother-in-law will appear a file missing, or no situation.

Here is a summary of the three missing files, in the installation of their own when the file is missing, according to which of the following steps to install the line, if missing two or three then install two three.

The first file is gmp.h.

As a bad memory of Ben three children, remember should be this file.

The reason for the lack of this file is that we generally do not have a GMP library of Ubuntu.

To use commands on Debian and Ubuntu systems:

sudo apt-get install Libgmp-dev

Use commands on Fedora, RedHat, and CentOS systems:

Yum Install Gmp-devel

After the GMP installation is complete, then use the command

$ pip Install Gmpy

A second file mpfr.h

First from ftp://ftp.gnu.org/gnu/mpfr/

Execute the following command in Kali:

Unzip Mpfr-3.1.5.zip

CD mpfr-3.1.5

./configure

Make

Make check

Verbose=1 make Check

Make install

A third file mpc.h

From Ftp://gcc.gnu.org/pub/gcc/infrastructure/

TAR-XZVF mpc-1.0.3.tar.gz

CD mpc-1.0.3

./configure

Make

Make install

After the installation resolves each file, the command to install the Gmpy2 module is executed so that you know if another file is missing until the installation is successful.

If this is not successful, you can comment on the contact, discuss together, learn together

Troubleshooting problems with Installing the Python module gmpy2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.