When trying to compile pyqt i have an error
i have installed all the prerequistes but its still showing the same problem please find an answer for this
22 Answers
For Python 2
sudo apt-get install python-devSince Python.h is provided by -dev
For Python 3
sudo apt-get install python3-dev the missing header file Python.h is in the python-dev package, first check that you have it installed:
$ dpkg --get-selections |grep python-dev
libboost-mpi-python-dev install
libboost-python-dev install
python-dev installYou can also use 'locate' to see if the file exists:
$ locate Python.h
/usr/include/python2.7/Python.hOnce you know that you have the header file, try to see where the compiler is looking for it:
cd PyQt_installation_dir
grep -r python2.7 .
...
./QtNetwork/QtNetwork.pro:INCLUDEPATH += /usr/local/include/python2.7
...In my case the problem was that the file was in /usr/include/python2.7, but the Makefile include path (-I) contained /usr/local/include/python2.7. To work around this, I made a link:
cd /usr/local/include
ln -s ../../include/python2.7 .Maybe there is a nicer way to do this, but at least the compilation worked.
Best, Harri
0