Ubuntu致命错误: Python.h:没有那个文件或目录解决方法

内容摘要
今天在实验室的ubuntu机子上安装Eventlet,在安装依赖包greenlet时出现错误,出现编译错误。
错误如下:

复制代码代码如下:
In file included from greenlet.c:5:0:
greenlet.h:
文章正文

今天在实验室的ubuntu机子上安装Eventlet,在安装依赖包greenlet时出现错误,出现编译错误。

错误如下:

复制代码
代码如下:

In file included from greenlet.c:5:0:
greenlet.h:8:20: 致命错误: Python.h:没有那个文件或目录
编译中断。
error: Setup script exited with error: command 'gcc' failed with exit status 1

解决方法是安装python-dev,这是Python的头文件和静态库包:

复制代码
代码如下:

sudo apt-get install python-dev


代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!