天天看點

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應該在系統上嗎?如果是,我應該安裝什麼來獲得它?