Skip to content Skip to sidebar Skip to footer

Cython Fatal Error: Python.h No Such File Or Directory

I have been using Cython to compile my Python files into C files and then use MinGW to create an executable from the C file. Cython works fine, I can type cython test.pyx into the

Solution 1:

you probably don't have python-dev installed. Depending on your OS, you'd need to do something like this:

sudo apt-get install python-dev

Which is what you'd do on Ubuntu

Solution 2:

in gcc

#include"file.h"

tells gcc to find the file in the same directory where test.c is, and

#include<file.h>

means to find file.h in the gcc include paths, which can be added with -I

gcc -I/path/to/the/file_h test.c

you might try

#include<Python.h>

also see fatal error: Python.h: No such file or directory

Post a Comment for "Cython Fatal Error: Python.h No Such File Or Directory"