Cygwin gcc issue - cannot find Python.h

cygwin, gcc, matplotlib, python

Solution

in cygwin make sure the python-devel package is installed:

- Run the cygwin installer (setup-x86(_64).exe

- Click through until you get to the page to install packages

- install the "python-devel" package from the "python" section. [Update from Comments] It is available as python2-devel or python3-devel under Python section for some.

Problem

So I downloaded Cygwin to build Matplotlib on Windows. Upon running python setup.py build I get a message saying Python.h cannot be found (pastebin). Looking in /usr/include/python2.7, I can clearly see Python.h exists. When I do: gcc -print-search-dirs I get paths to some Haskell folder outside of the cygwin installation folder. Full output here.

Original source