无法编译由 cython 生成的 .c 文件



我正在使用cython将我的python文件转换为c文件,但是当我尝试编译c文件时,它对我来说失败了。

Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.

我读了这篇文章: Cython 致命错误: Python.h 没有这样的文件或目录

但我无法理解。我尝试使用#include <Python.h>而不是#include "Python.h它对我来说也失败了。

有什么解决办法吗?谢谢。

使用:

sudo updatedb
locate Python.h
export CPATH=/usr/include/python3.5m:$CPATH 
(change your python version here)
export LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH

最新更新