0

Im trying to crate a cryptosystem on the raspbian OS. Chose python and pycrypto because the OS comes with python 3.2.3 pre-installed. Moved the "pycrypto-2.6.1.tar.gz" to the folder where python files are located and extracted there. Suposed to build using the command "python setup.py build" and then install.

But during the build phase, keep getting the error:

"pi@raspberrypi /usr/lib/python3.2/pycrypto-2.6.1 $ python setup.py buildrunning build
running build_py
running build_ext
running build_configure
warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash._MD2' extension
gcc -pthread -fno-strict-aliasing -fwrapv -Wall -Wstrict-prototypes -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python2.7 -c src/MD2.c -o build/temp.linux-armv6l-2.7/src/MD2.o
src/MD2.c:31:20: fatal error: Python.h: No such file or directory
compilation terminated.
    error: command 'gcc' failed with exit status 1

"

Not able to figure out whether I am supposed to change the pathing. Could somebody give an insight in to this?

Clodion
  • 1,017
  • 6
  • 12

1 Answers1

0

warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.

The libgmp-dev package provides the necessary files to support building the optimized module here:

apt-get install libgmp-dev

src/MD2.c:31:20: fatal error: Python.h: No such file or directory compilation terminated.

If you search for fatal error: Python.h: No such file or directory, the very first Google result is for this StackOverflow question, which tells you that you need to install the python-dev package:

apt-get install python-dev

In general, if you are building software from source you will need the corresponding -dev package for any required libraries; these packages provide header files (foo.h) and the unversioned shared libraries necessary for linking.

Community
  • 1
  • 1
larsks
  • 277,717
  • 41
  • 399
  • 399
  • Followed your directions, I have it installed. Thank you so much. It makes more sense than when I began. – panickedprocrastinator Jul 28 '15 at 00:10
  • i have installed libgmp-dev. Below I've shown the instance were the update i successful. But the build command for pycrypto still fails on a GMP or MPIR fail. – panickedprocrastinator Jul 28 '15 at 17:01
  • pi@raspberrypi ~ $ sudo apt-get install libgmp-dev Reading package lists... Done Building dependency tree Reading state information... Done libgmp-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 82 not upgraded. pi@raspberrypi ~ $ sudo apt-get install python-dev Reading package lists... Done Building dependency tree Reading state information... Done python-dev is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 82 not upgraded. – panickedprocrastinator Jul 28 '15 at 17:03
  • pi@raspberrypi ~ $ cd /usr/lib/python3.2/pycrypto-2.6.1/ pi@raspberrypi /usr/lib/python3.2/pycrypto-2.6.1 $ python setup.py build running build running build_py running build_ext running build_configure warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath. – panickedprocrastinator Jul 28 '15 at 17:04