While creating rpm for Python-2.7.15 on centos 7.5. I was creating rpm using below command.
python setup.py bdist_rpm
.....
......
.....
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.UFJQ7P
+ umask 022
+ cd /root/rpmbuild/SOURCES/Python-2.7.15/build/bdist.linux-x86_64/rpm/BUILD
+ cd Python-2.7.5
+ env 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' python setup.py build
running build
running build_ext
error: pyconfig.h: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.UFJQ7P (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.UFJQ7P (%build)
error: command 'rpmbuild' failed with exit status 1
pyconfig.h
is part of the python-devel package on CentOS. Install it with
sudo yum install python-devel
For debian based distros use
sudo apt-get install python-dev
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.