Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python2 setup.py build error #650

Closed
gagestinson opened this issue Jul 16, 2023 · 3 comments
Closed

python2 setup.py build error #650

gagestinson opened this issue Jul 16, 2023 · 3 comments

Comments

@gagestinson
Copy link

I get the following output when running sudo python2 setup.py build

running build running build_py running build_ext building 'cpyrit._cpyrit_cpu' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -ffile-prefix-map=/build/python2.7-vgIf7a/python2.7-2.7.18=. -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 -ffile-prefix-map=/build/python2.7-vgIf7a/python2.7-2.7.18=. -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

I am unsure what I am doing wrong here

@puzhibin996
Copy link

me too

@meezlung
Copy link

meezlung commented Sep 6, 2023

It looks like the error message you're seeing indicates that the compilation of Python extension module is falling because it can't find Python.h. "fatal error: Python.h: No such file or directory" typically occurs when the development headers for Python are not installed on your system.

To fix, install python development headers:
$ sudo apt-get install python-dev

This should fix it.

Also, please consider using Python3.

Goodluck!

@jkennebe
Copy link

jkennebe commented Sep 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants