Pyrit icon indicating copy to clipboard operation
Pyrit copied to clipboard

cpyrit/_cpyrit_cpu.c:32:10: fatal error: Python.h: No such file or directory

Open MrHim opened this issue 4 years ago • 7 comments

:~/Pyrit$ python setup.py build running build running build_py 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-IzSqQI/python2.7-2.7.18~rc1=. -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.1" -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-IzSqQI/python2.7-2.7.18~rc1=. -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.1" 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

MrHim avatar Apr 14 '20 00:04 MrHim

Run the following: sudo apt-get update && sudo apt-get install python-dev python3-dev

Compiling from source-code is the preferred way of getting Pyrit onto your system. Linux users running a binary distribution may need to install the development packages for:

Python e.g. python-devel (CentOS/Fedora) or python-dev (Ubuntu/Debian)
OpenSSL e.g. openssl-devel or libssl-dev (you get which one) and
Zlib (e.g. zlib-devel).

https://github.com/JPaulMora/Pyrit/wiki#general-dependencies

njaksch avatar Apr 20 '20 23:04 njaksch

:~/Pyrit$ python setup.py build running build running build_py 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-IzSqQI/python2.7-2.7.18~rc1=. -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.1" -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-IzSqQI/python2.7-2.7.18~rc1=. -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.1" 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

same crap damn!

ruslan051 avatar May 01 '20 01:05 ruslan051

Run the following: sudo apt-get update && sudo apt-get install python-dev python3-dev

EDIT: My blind-self realized he put "python-dev", which is for python2.x versions

Pyrit is built for Python 2* so, try sudo apt-get install python2.7

If not, try changing your CLI to python2 setup.py clean build install

RootSrc avatar May 01 '20 06:05 RootSrc

Installing python-dev solves the problem. This issue can be closed. I also suggest updating the Wiki with this information, or creating a troubleshooting guide.

demonCoder95 avatar Jan 26 '21 07:01 demonCoder95

Thanks for the above now i get error: cpyrit/_cpyrit_cpu.c:35:10: fatal error: openssl/hmac.h: No such file or directory

whiteforcekali16 avatar Oct 06 '21 14:10 whiteforcekali16

Hello guys, I managed to get Pyrit working with CUDA on latest kali. Seems to me the most common issue is trying old libraries and/or Python3 which is not supported yet.

As I've stated before, there's plans to upgrade (and improve Pyrit) but for now I'll just update the wiki with working instructions.

JPaulMora avatar Oct 06 '21 15:10 JPaulMora

hi john i was able to get it to compile but the analyze option doesn't work due to scapy.

whiteforcekali16 avatar Oct 07 '21 00:10 whiteforcekali16