pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.07k stars 232 forks source link

gcc build fails on AWS ARM Linux 2 with fatal error: pyconfig.h: No such file or directory #733

Closed dawgfather closed 2 years ago

dawgfather commented 2 years ago

I have pyconfig.h in these locations: /usr/bin/aws/dist/include/python3.8/pyconfig.h /usr/local/aws-cli/v2/2.4.7/dist/include/python3.8/pyconfig.h /home/ec2-user/aws/dist/include/python3.8/pyconfig.h

full gcc command

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -moutline-atomics -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -moutline-atomics -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -moutline-atomics -D_GNU_SOURCE -fPIC -fwrapv -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -moutline-atomics -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -moutline-atomics -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -moutline-atomics -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/home/ec2-user/.local/share/virtualenvs/ec2-user-zzkNbF-x/include -I/usr/include/python3.8 -Ibuild/temp.linux-aarch64-3.8/include -c build/temp.linux-aarch64-3.8/_sodium.c -o build/temp.linux-aarch64-3.8/build/temp.linux-aarch64-3.8/_sodium.o build/temp.linux-aarch64-3.8/_sodium.c:50:14: fatal error: pyconfig.h: No such file or directory

include

            ^~~~~~~~~~~~

compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1

ERROR: Failed building wheel for pynacl

reaperhulk commented 2 years ago

Include paths for things like pyconfig are supplied by the Python runtime itself, which suggests that your environment probably won't successfully compile any native modules. It would probably be good to work out what's going on there, but you could also work around this by manually passing the right include via CFLAGS.

dawgfather commented 2 years ago

AWS support - I was missing this package $ sudo yum install -y python38 python38-devel gcc make