Pyrit icon indicating copy to clipboard operation
Pyrit copied to clipboard

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Open MahmoudSharkawy opened this issue 4 years ago • 8 comments

idoctor@kali:~/Downloads/Pyrit-v0.5.0$ sudo python setup.py install
[sudo] password for idoctor: 
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying pyrit_cli.py -> build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/__init__.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/cpyrit.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/util.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/pckttools.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/config.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/network.py -> build/lib.linux-x86_64-2.7/cpyrit
copying cpyrit/storage.py -> build/lib.linux-x86_64-2.7/cpyrit
running build_ext
building 'cpyrit._cpyrit_cpu' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/cpyrit
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-07FOaN/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c cpyrit/_cpyrit_cpu.c -o build/temp.linux-x86_64-2.7/cpyrit/_cpyrit_cpu.o -Wall -fno-strict-aliasing -DVERSION="0.5.0" -maes -mpclmul
cpyrit/_cpyrit_cpu.c:32:10: fatal error: Python.h: No such file or directory
   32 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.
Failed to build; Compiling without AES-NI
building 'cpyrit._cpyrit_cpu' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-07FOaN/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c cpyrit/_cpyrit_cpu.c -o build/temp.linux-x86_64-2.7/cpyrit/_cpyrit_cpu.o -Wall -fno-strict-aliasing -DVERSION="0.5.0"                                                                                               
cpyrit/_cpyrit_cpu.c:32:10: fatal error: Python.h: No such file or directory
   32 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.                                                                                          
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

MahmoudSharkawy avatar Mar 20 '20 05:03 MahmoudSharkawy

same here also when try to install it from kali with: apt install pyrit it give Package 'pyrit' has no installation candidate:

Father147 avatar Apr 05 '20 21:04 Father147

same here

ricojones121 avatar Apr 14 '20 00:04 ricojones121

sudo apt-get install python3 python-dev python3-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev

sudo ./setup.py build install

this should work

RattlingAmigo avatar Apr 20 '20 15:04 RattlingAmigo

Make sure to use Python2, as Pyrit has not been updated to Python3 yet sudo apt-get install python2.7 or python2 clean build install if you already have Python2

RootSrc avatar May 01 '20 06:05 RootSrc

Make sure to use Python2, as Pyrit has not been updated to Python3 yet sudo apt-get install python2.7 or python2 clean build install if you already have Python2

I Have tried every mentioned solution above and yours too... Still i'm getting same error but with a diiference. instead of python.h fatal error, it says pcap.h.... Please help

Tarun1921 avatar May 12 '20 08:05 Tarun1921

Whats your O.S? Try : sudo apt-get install libpcap-dev

Generally when you see a header file missing {NAME}.h, Google the header name followed by "missing", 99% of the time you'll find your problem. :)

RootSrc avatar May 16 '20 09:05 RootSrc

Make sure to use Python2, as Pyrit has not been updated to Python3 yet sudo apt-get install python2.7 or python2 clean build install if you already have Python2

Bingo. Thank you kindly!

OverUnity1776 avatar Mar 27 '22 02:03 OverUnity1776

This is the only way it worked for me. Completely uninstalled and reinstalled everything needed. Hope it helps someone. https://github.com/hacker3983/pyrit-installer

vaedrae avatar Feb 11 '24 06:02 vaedrae