天天看点

python h缺_Ubuntu 12.04中缺少Python.h

我对python很陌生,我在Linux电脑(Ubunutu 12.04)上安装了一个名为RYU的openflow控制器,使用:sudo pip install ryu

我试图使用ryu管理器运行一个python文件,如下所示。sudo ryu-manager simple_switch.py

Traceback (most recent call last):

File "/usr/local/bin/ryu-manager", line 19, in

import gevent

ImportError: No module named gevent

然后我尝试使用以下方法安装gevent:sudo pip install gevent

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c gevent/core.c -o build/temp.linux-x86_64-2.7/gevent/core.o

gevent/core.c:4:20: fatal error: Python.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1

这个错误的原因是什么?我试图使用以下命令查找Python.h文件:sudo locate Python.h

我在系统上找不到。但是如果我运行:python -V

我得到输出:Python 2.7.3

Python.h应该在系统上吗?如果是,我应该安装什么来获得它?