Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cygwin gcc issue - cannot find Python.h

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.

like image 534
Rickkwa Avatar asked Feb 18 '14 03:02

Rickkwa


People also ask

What is python H?

Python.h is nothing but a header file. It is used by gcc to build applications. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications.

What is python3 Dev?

python-dev is the package that contains the header files for the Python C API, which is used by lxml because it includes Python C extensions for high performance.


1 Answers

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.
like image 163
Matt Cecil Avatar answered Sep 30 '22 15:09

Matt Cecil