0

I am running Centos7 with Python 3.6. I am trying to install pycrypto with the command "pip3 install pycrypto". I also installed the dev tools, so gcc is installed. I am getting the following output. What am I missing?

    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
    building 'Crypto.Hash._MD2' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -Wno-unused-result -Wsign-compare -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/python3.6m -c src/MD2.c -o build/temp.linux-x86_64-3.6/src/MD2.o
    src/MD2.c:31:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h6pl3s2f/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-9fjag3e5-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-h6pl3s2f/pycrypto/
user2236794
  • 441
  • 3
  • 7
  • 22
  • Does this answer your question? [setup script exited with error: command 'x86\_64-linux-gnu-gcc' failed with exit status 1](https://stackoverflow.com/questions/26053982/setup-script-exited-with-error-command-x86-64-linux-gnu-gcc-failed-with-exit) – MatthewMartin Jan 25 '21 at 00:06

2 Answers2

0

That did not work, but I did find the answer in the article.

I ran "yum -y install python3-devel" and this fixed my issue. I was then able to install pycrypto.

user2236794
  • 441
  • 3
  • 7
  • 22
0

I also had the same issue for CentOS. However, it turned out I was missing one of the dependencies.

sudo yum install gcc

sudo yum install gcc-c++

sudo yum install python-devel

sudo pip install pycrypto
Sky
  • 111
  • 2